diff --git a/devstack-vm-gate-wrap.sh b/devstack-vm-gate-wrap.sh index 7a660f51..60736b71 100755 --- a/devstack-vm-gate-wrap.sh +++ b/devstack-vm-gate-wrap.sh @@ -211,45 +211,61 @@ if [ ${DEFAULT_CONCURRENCY} -gt 3 ] ; then fi export TEMPEST_CONCURRENCY=${TEMPEST_CONCURRENCY:-${DEFAULT_CONCURRENCY}} -# The following variables are set for different directions of Grenade updating +# The following variable is set for different directions of Grenade updating # for a stable branch we want to both try to upgrade forward n => n+1 as # well as upgrade from last n-1 => n. # # i.e. stable/icehouse: -# DGG=1 means stable/havana => stable/icehouse -# DGGF=1 means stable/icehouse => master (or stable/juno if that's out) -export DEVSTACK_GATE_GRENADE=${DEVSTACK_GATE_GRENADE:-0} -export DEVSTACK_GATE_GRENADE_FORWARD=${DEVSTACK_GATE_GRENADE_FORWARD:-0} -# DGGPN=1 means upgrade everything but n-cpu. +# pullup means stable/havana => stable/icehouse +# forward means stable/icehouse => master (or stable/juno if that's out) +# partial-ncpu means stable/havana => stable/icehouse but keep nova +# compute at stable/havana +# sideways-ironic means stable/icehouse with nova baremetal => +# stable/icehouse with ironic +# sideways-neutron means stable/icehouse with nova network => +# stable/icehouse with neutron +export DEVSTACK_GATE_GRENADE=${DEVSTACK_GATE_GRENADE:-} +# This is here for backward compat. +# TODO(clarkb) remove this once job defs are updated. export DEVSTACK_GATE_GRENADE_PARTIAL_NCPU=${DEVSTACK_GATE_GRENADE_PARTIAL_NCPU:-0} # the branch name for selecting grenade branches GRENADE_BASE_BRANCH=${OVERRIDE_ZUUL_BRANCH:-${ZUUL_BRANCH}} -if [ "$DEVSTACK_GATE_GRENADE" -eq "1" ]; then +# TODO(clarkb) clean up condition once job defs are updated. +if [[ "$DEVSTACK_GATE_GRENADE" == "pullup" ]] || [[ "$DEVSTACK_GATE_GRENADE" -eq "1" ]]; then export DEVSTACK_GATE_TEMPEST=1 - if [ "$GRENADE_BASE_BRANCH" == "stable/icehouse" ]; then + if [[ "$GRENADE_BASE_BRANCH" == "stable/icehouse" ]]; then export GRENADE_OLD_BRANCH="stable/havana" export GRENADE_NEW_BRANCH="stable/icehouse" else # master export GRENADE_OLD_BRANCH="stable/icehouse" export GRENADE_NEW_BRANCH="$GIT_BRANCH" fi - if [ "$DEVSTACK_GATE_GRENADE_PARTIAL_NCPU" -eq "1" ]; then - export DO_NOT_UPGRADE_SERVICES=[n-cpu] - else - export DO_NOT_UPGRADE_SERVICES= - fi - # the roll forward case -elif [ "$DEVSTACK_GATE_GRENADE_FORWARD" -eq "1" ]; then +# TODO(clarkb) clean up condition once job defs are updated. +elif [[ "$DEVSTACK_GATE_GRENADE" == "partial-ncpu" ]] || [[ "$DEVSTACK_GATE_GRENADE_PARTIAL_NCPU" -eq "1" ]]; then export DEVSTACK_GATE_TEMPEST=1 - if [ "$GRENADE_BASE_BRANCH" == "stable/havana" ]; then + export DO_NOT_UPGRADE_SERVICES=[n-cpu] + if [[ "$GRENADE_BASE_BRANCH" == "stable/icehouse" ]]; then export GRENADE_OLD_BRANCH="stable/havana" export GRENADE_NEW_BRANCH="stable/icehouse" - elif [ "$GRENADE_BASE_BRANCH" == "stable/icehouse" ]; then + else # master export GRENADE_OLD_BRANCH="stable/icehouse" export GRENADE_NEW_BRANCH="$GIT_BRANCH" fi +elif [[ "$DEVSTACK_GATE_GRENADE" == "forward" ]]; then + export DEVSTACK_GATE_TEMPEST=1 + if [[ "$GRENADE_BASE_BRANCH" == "stable/havana" ]]; then + export GRENADE_OLD_BRANCH="stable/havana" + export GRENADE_NEW_BRANCH="stable/icehouse" + elif [[ "$GRENADE_BASE_BRANCH" == "stable/icehouse" ]]; then + export GRENADE_OLD_BRANCH="stable/icehouse" + export GRENADE_NEW_BRANCH="$GIT_BRANCH" + fi +elif [[ "$DEVSTACK_GATE_GRENADE" =~ "sideways" ]]; then + export DEVSTACK_GATE_TEMPEST=1 + export GRENADE_OLD_BRANCH="$GRENADE_BASE_BRANCH" + export GRENADE_NEW_BRANCH="$GRENADE_BASE_BRANCH" fi # Set the virtualization driver to: libvirt, openvz, xenapi @@ -300,7 +316,7 @@ echo "Setting up the host" echo "... this takes a few seconds (logs at logs/devstack-gate-setup-host.txt.gz)" tsfilter setup_host &> $WORKSPACE/logs/devstack-gate-setup-host.txt -if [ "$DEVSTACK_GATE_GRENADE" -eq "1" -o "$DEVSTACK_GATE_GRENADE_FORWARD" -eq "1" ]; then +if [ -n "$DEVSTACK_GATE_GRENADE" ]; then echo "Setting up the new (migrate to) workspace" echo "... this takes 3 - 5 minutes (logs at logs/devstack-gate-setup-workspace-new.txt.gz)" tsfilter setup_workspace $GRENADE_NEW_BRANCH $BASE/new copycache &> \ diff --git a/devstack-vm-gate.sh b/devstack-vm-gate.sh index 8ecad84a..48157cc7 100755 --- a/devstack-vm-gate.sh +++ b/devstack-vm-gate.sh @@ -56,7 +56,7 @@ function setup_localrc() { # we don't want to enable services for grenade that don't have upgrade support # otherwise they can break grenade, especially when they are projects like # ceilometer which inject code in other projects - if [[ "$DEVSTACK_GATE_GRENADE" -eq "1" ]]; then + if [[ -n "$DEVSTACK_GATE_GRENADE" ]]; then SKIP_EXERCISES=${SKIP_EXERCISES},swift,client-args fi fi @@ -187,7 +187,7 @@ EOF echo "TEMPEST_ALLOW_TENANT_ISOLATION=False" >>localrc fi - if [[ "$DEVSTACK_GATE_GRENADE" -eq "1" ]]; then + if [[ -n "$DEVSTACK_GATE_GRENADE" ]]; then echo "DATA_DIR=/opt/stack/data" >> localrc echo "SWIFT_DATA_DIR=/opt/stack/data/swift" >> localrc if [[ "$LOCALRC_OLDNEW" == "old" ]]; then @@ -240,10 +240,32 @@ EOF fi } -if [[ "$DEVSTACK_GATE_GRENADE" -eq "1" ]]; then +if [[ -n "$DEVSTACK_GATE_GRENADE" ]]; then + if [[ "$DEVSTACK_GATE_GRENADE" == "sideways-ironic" ]]; then + # Disable ironic when generating the "old" localrc. + local tmp_DEVSTACK_GATE_IRONIC=$DEVSTACK_GATE_IRONIC + local tmp_DEVSTACK_GATE_VIRT_DRIVER=$DEVSTACK_GATE_VIRT_DRIVER + export DEVSTACK_GATE_IRONIC=0 + export DEVSTACK_GATE_VIRT_DRIVER="fake" + fi + if [[ "$DEVSTACK_GATE_GRENADE" == "sideways-neutron" ]]; then + # Use nova network when generating "old" localrc. + local tmp_DEVSTACK_GATE_NEUTRON=$DEVSTACK_GATE_NEUTRON + export DEVSTACK_GATE_NEUTRON=0 + fi cd $BASE/old/devstack setup_localrc "old" "$GRENADE_OLD_BRANCH" + if [[ "$DEVSTACK_GATE_GRENADE" == "sideways-ironic" ]]; then + # Set ironic and virt driver settings to those initially set + # by the job. + export DEVSTACK_GATE_IRONIC=$tmp_DEVSTACK_GATE_IRONIC + export DEVSTACK_GATE_VIRT_DRIVER=$tmp_DEVSTACK_GATE_VIRT_DRIVER + fi + if [[ "$DEVSTACK_GATE_GRENADE" == "sideways-neutron" ]]; then + # Set neutron setting to that initially set by the job. + export DEVSTACK_GATE_NEUTRON=$tmp_DEVSTACK_GATE_NEUTRON + fi cd $BASE/new/devstack setup_localrc "new" "$GRENADE_OLD_BRANCH" diff --git a/test-features.sh b/test-features.sh index b4cfcff0..3e53b63a 100755 --- a/test-features.sh +++ b/test-features.sh @@ -71,17 +71,17 @@ function test_heat_slow_master { } function test_grenade_new_master { - local results=$(DEVSTACK_GATE_TEMPEST_HEAT_SLOW=1 DEVSTACK_GATE_GRENADE=1 DEVSTACK_GATE_TEMPEST=1 ./test-matrix.py) + local results=$(DEVSTACK_GATE_TEMPEST_HEAT_SLOW=1 DEVSTACK_GATE_GRENADE=pullup DEVSTACK_GATE_TEMPEST=1 ./test-matrix.py) assert_list_equal $GRENADE_NEW_MASTER $results } function test_grenade_havana_master { - local results=$(DEVSTACK_GATE_GRENADE=1 DEVSTACK_GATE_TEMPEST=1 ./test-matrix.py -b stable/havana) + local results=$(DEVSTACK_GATE_GRENADE=pullup DEVSTACK_GATE_TEMPEST=1 ./test-matrix.py -b stable/havana) assert_list_equal $GRENADE_HAVANA_MASTER $results } function test_grenade_icehouse_master { - local results=$(DEVSTACK_GATE_GRENADE=1 DEVSTACK_GATE_TEMPEST=1 ./test-matrix.py -b stable/icehouse) + local results=$(DEVSTACK_GATE_GRENADE=pullup DEVSTACK_GATE_TEMPEST=1 ./test-matrix.py -b stable/icehouse) assert_list_equal $GRENADE_ICEHOUSE_MASTER $results } diff --git a/test-matrix.py b/test-matrix.py index d58bab4a..f47ee865 100755 --- a/test-matrix.py +++ b/test-matrix.py @@ -22,6 +22,7 @@ import yaml GRID = None ALLOWED_BRANCHES = [] +FALSE_VALUES = [None, '', '0', 'false', 'False', 'FALSE'] FORMAT = '%(asctime)s %(levelname)s: %(message)s' logging.basicConfig(format=FORMAT) @@ -66,7 +67,7 @@ def configs_from_env(): configs = [] for k, v in os.environ.iteritems(): if k.startswith('DEVSTACK_GATE_'): - if v == '1': + if v not in FALSE_VALUES: f = k.split('DEVSTACK_GATE_')[1] configs.append(f.lower()) return configs