From patchwork Thu Aug 6 18:41:03 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Goldish X-Patchwork-Id: 39666 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n76IdIOv012674 for ; Thu, 6 Aug 2009 18:39:19 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754239AbZHFSig (ORCPT ); Thu, 6 Aug 2009 14:38:36 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754131AbZHFSig (ORCPT ); Thu, 6 Aug 2009 14:38:36 -0400 Received: from mx2.redhat.com ([66.187.237.31]:53467 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754223AbZHFSid (ORCPT ); Thu, 6 Aug 2009 14:38:33 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n76IcY46025116; Thu, 6 Aug 2009 14:38:34 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n76IcXvv027557; Thu, 6 Aug 2009 14:38:33 -0400 Received: from localhost.localdomain (dhcp-1-31.tlv.redhat.com [10.35.1.31]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n76IcRRR008251; Thu, 6 Aug 2009 14:38:32 -0400 From: Michael Goldish To: autotest@test.kernel.org, kvm@vger.kernel.org Cc: Michael Goldish Subject: [KVM-AUTOTEST PATCH 03/12] KVM test: add sample 'qemu-ifup' script Date: Thu, 6 Aug 2009 21:41:03 +0300 Message-Id: In-Reply-To: References: <1249584064-20355-1-git-send-email-mgoldish@redhat.com> In-Reply-To: References: X-Scanned-By: MIMEDefang 2.58 on 172.16.27.26 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org The script adds a requested interface to an existing bridge. It is meant to be used by qemu when running in TAP mode. Note: the user is responsible for setting up the bridge before running any tests. This can be done with brctl or in any manner that is appropriate for the host OS. It can be done inside 'qemu-ifup' as well, but this sample script doesn't do it. Signed-off-by: Michael Goldish --- client/tests/kvm/qemu-ifup | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) create mode 100755 client/tests/kvm/qemu-ifup diff --git a/client/tests/kvm/qemu-ifup b/client/tests/kvm/qemu-ifup new file mode 100755 index 0000000..bcd9a7a --- /dev/null +++ b/client/tests/kvm/qemu-ifup @@ -0,0 +1,8 @@ +#!/bin/sh + +# The following expression selects the first bridge listed by 'brctl show'. +# Modify it to suit your needs. +switch=$(/usr/sbin/brctl show | awk 'NR==2 { print $1 }') + +/sbin/ifconfig $1 0.0.0.0 up +/usr/sbin/brctl addif ${switch} $1