From 8f42515af521bfd617f1a91c43bb51d65d5d0312 Mon Sep 17 00:00:00 2001 From: Devananda van der Veen Date: Wed, 25 Jul 2012 00:31:14 +0000 Subject: [PATCH] various small changes to test openvz driver Change-Id: Ia98d2e3706da6b89724612eec51ac20ba730b1e2 --- devstack-vm-gate-wrap.sh | 8 ++++++++ devstack-vm-gate.sh | 14 ++++++++++++++ devstack-vm-update-image.py | 4 ++-- 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/devstack-vm-gate-wrap.sh b/devstack-vm-gate-wrap.sh index f7c4fedd..2d4a7044 100755 --- a/devstack-vm-gate-wrap.sh +++ b/devstack-vm-gate-wrap.sh @@ -24,6 +24,9 @@ PROJECTS="openstack-dev/devstack openstack/nova openstack/glance openstack/keyst # Set to 1 to run the Tempest test suite export DEVSTACK_GATE_TEMPEST=${DEVSTACK_GATE_TEMPEST:-0} +# Set the virtualization driver to: libvirt, openvz +export DEVSTACK_GATE_VIRT_DRIVER=${DEVSTACK_GATE_VIRT_DRIVER:-libvirt} + # See switch below for this -- it gets set to 1 when tempest # is the project being gated. export DEVSTACK_GATE_TEMPEST_FULL=${DEVSTACK_GATE_TEMPEST_FULL:-0} @@ -142,6 +145,11 @@ function setup_host { sudo chown root:root $TEMPFILE sudo mv $TEMPFILE /etc/sudoers.d/50_stack_sh + # If we will be testing OpenVZ, make sure stack is a member of the vz group + if [ "$DEVSTACK_GATE_VIRT_DRIVER" == "openvz" ]; then + sudo usermod -a -G vz stack + fi + # Disable detailed logging as we return to the main script set +o xtrace } diff --git a/devstack-vm-gate.sh b/devstack-vm-gate.sh index 323e522e..37596580 100755 --- a/devstack-vm-gate.sh +++ b/devstack-vm-gate.sh @@ -55,9 +55,23 @@ SYSLOG=True SCREEN_LOGDIR=$DEST/screen-logs FIXED_RANGE=10.1.0.0/24 FIXED_NETWORK_SIZE=256 +VIRT_DRIVER=$DEVSTACK_GATE_VIRT_DRIVER export OS_NO_CACHE=True EOF +if [ "$DEVSTACK_GATE_VIRT_DRIVER" == "openvz" ]; then + cat <<\EOF >>localrc +SKIP_EXERCISES=${SKIP_EXERCISES},volumes +DEFAULT_INSTANCE_TYPE=m1.small +DEFAULT_INSTANCE_USER=root +EOF + + cat <>exerciserc +DEFAULT_INSTANCE_TYPE=m1.small +DEFAULT_INSTANCE_USER=root +EOF +fi + if [ "$DEVSTACK_GATE_TEMPEST" -eq "1" ]; then # We need to disable ratelimiting when running # Tempest tests since so many requests are executed diff --git a/devstack-vm-update-image.py b/devstack-vm-update-image.py index e86b4702..3cfdc298 100755 --- a/devstack-vm-update-image.py +++ b/devstack-vm-update-image.py @@ -203,7 +203,7 @@ def configure_server(server, branches): 'ls ~/cache/files/%s' % fname) except: client.ssh('download image %s' % fname, - 'wget -c %s -O ~/cache/files/%s' % (url, fname)) + 'wget -nv -c %s -O ~/cache/files/%s' % (url, fname)) client.ssh('clear workspace', 'rm -rf ~/workspace-cache') client.ssh('make workspace', 'mkdir -p ~/workspace-cache') @@ -218,7 +218,7 @@ def configure_server(server, branches): bn = os.path.basename(script) client.scp(script, '/tmp/%s' % bn) client.ssh('run custom script %s' % bn, - 'chmod +x /tmp/%s && /tmp/%s' % (bn, bn)) + 'chmod +x /tmp/%s && sudo /tmp/%s' % (bn, bn)) client.ssh('sync', 'sync && sleep 5')