DEFAULT_FCDISTRO=f16
DEFAULT_PLDISTRO=planetlab
DEFAULT_PERSONALITY=linux64
-DEFAULT_IFNAME=eth0
COMMAND_VBUILD="vbuild-init-lxc.sh"
COMMAND_MYPLC="vtest-init-lxc.sh"
libvirt_version="1.0.4"
+
+## stolen from tests/system/template-qemu/qemu-bridge-init
+#################### compute INTERFACE_LAN
+# use /proc/net/dev instead of a hard-wired list
+function gather_interfaces () {
+ python <<EOF
+for line in file("/proc/net/dev"):
+ if ':' not in line: continue
+ ifname=line.replace(" ","").split(":")[0]
+ if ifname.find("lo")==0: continue
+ if ifname.find("br")==0: continue
+ if ifname.find("virbr")==0: continue
+ if ifname.find("tap")==0: continue
+ print ifname
+EOF
+}
+
+function discover_interface () {
+ for ifname in $(gather_interfaces); do
+ ip link show $ifname | grep -qi 'state UP' && { echo $ifname; return; }
+ done
+ # still not found ? that's bad
+ echo unknown
+}
+DEFAULT_IFNAME=$(discover_interface)
+
function bridge_init () {
# turn on verbosity
function prepare_host() {
- host_fcdistro="$(cat /etc/fedora-release | cut -d' ' -f3)"
- ## check if libvirt_version is installed
- virsh -v | grep -e $libvirt_version || { echo "$libvirt_version needs to be installed!!!" ; exit 1 ; }
-# host_fcdistro="$(cat /etc/fedora-release | cut -d' ' -f3)"
-# if [ ! -f /etc/yum.repos.d/libvirt.repo ] ; then
-# touch /etc/yum.repos.d/libvirt.repo
-# cat <<EOF > /etc/yum.repos.d/libvirt.repo
-#[libvirt]
-#name=libvirt-1.0.2-1
-#baseurl=http://build.onelab.eu/lxc/2013.02.25--lxc$host_fcdistro/RPMS/
-#enabled=1
-#gpgcheck=0
-#EOF
-#
-# yum --assumeno update
-# check_yumgroup_installed "Development Tools"
-# check_yum_installed libcap-devel
-# check_yum_installed libvirt
-# systemctl start libvirtd
-# fi
+### Thierry - jan 14 - turning off this check as our boxes now meet this req.
+### and I'm trying out f20's stock libvirt instead
+# ## check if libvirt_version is installed
+# virsh -v | grep -e $libvirt_version || { echo "$libvirt_version needs to be installed!!!" ; exit 1 ; }
#################### bride initialization
check_yum_installed bridge-utils