X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lbuild-nightly.sh;h=fd7809a53474d5f93c224adb9a2733413adf6a4c;hb=c2cf3c8ffae823d4c2fca6f4b242f6b61eed910f;hp=f44e1e2d799e715d3f53833241944d7288d24e91;hpb=9f78868e322225c40e8ec008d91510aa5bdb03ea;p=build.git diff --git a/lbuild-nightly.sh b/lbuild-nightly.sh index f44e1e2d..fd7809a5 100755 --- a/lbuild-nightly.sh +++ b/lbuild-nightly.sh @@ -52,6 +52,20 @@ function logfile () { echo /vservers/$slice.log.txt } +######################################## +# workaround for broken lxc-enter-namespace +# 1st version was relying on virsh net-dhcp-leases +# however this was too fragile, would not work for fedora14 containers +# WARNING: this code is duplicated in lbuild-initvm.sh +function guest_ipv4() { + lxc=$1; shift + + mac=$(virsh -c lxc:/// domiflist $lxc | egrep 'network|bridge' | awk '{print $5;}') + # sanity check + [ -z "$mac" ] && return 0 + arp -en | grep "$mac" | awk '{print $1;}' +} + # wrap a quick summary of suspicious stuff # this is to focus on installation that go wrong # use with care, a *lot* of other things can go bad as well @@ -231,13 +245,6 @@ function in_root_context () { rpm -q libvirt > /dev/null } -### lxc-enter-namespace being broken, let us try to work around this issue -# lbuild-initvm.sh stores the guest ipv4 address in /vservers//ipv4 -function guest_ipv4 () { - buildname=$1; shift - cat /vservers/$buildname/ipv4 -} - # convenient for simple commands function run_in_build_guest () { buildname=$1; shift @@ -318,7 +325,7 @@ function run_log () { ssh -n ${testmaster_ssh} rm -rf ${testdir} ${testdir}.git # check it out in the build - run_in_build_guest /bin/bash -c "make -C /build tests-module ${MAKEVARS[@]}" + run_in_build_guest $BASE make -C /build tests-module ${MAKEVARS[@]} # push it onto the testmaster - just the 'system' subdir is enough rsync --verbose --archive $(rootdir $BASE)/build/MODULES/tests/system/ ${testmaster_ssh}:${BASE} @@ -717,7 +724,7 @@ function main () { rm -rf $tmpdir # Extract build again - in the vm [ -n "$SSH_KEY" ] && setupssh ${BASE} ${SSH_KEY} - run_in_build_guest_raw $BASE "(git clone $GIT_REPO /build; cd /build; git checkout $GIT_TAG)" + run_in_build_guest $BASE "(git clone $GIT_REPO /build; cd /build; git checkout $GIT_TAG)" fi echo "XXXXXXXXXX $COMMAND: preparation of vm $BASE done" $(date)