From 38321998902097ccb376f94ee96df6c371142ee3 Mon Sep 17 00:00:00 2001 From: Yaroslav Lobankov Date: Wed, 27 Apr 2016 17:45:16 +0300 Subject: [PATCH] [Verify] Add 'version' arg to install/reinstall cmd For now Rally always installs Tempest from the master branch. It is not very convenient because Tempest may be broken in the master branch and it would be very useful to use some commit or tag for Tempest. So this commit adds a possibility to checkout the specified commit or tag before Tempest installation. Change-Id: Icfbb4221005466139c14d3f4aae34bbb3e013982 --- etc/rally.bash_completion | 6 +++--- tests/ci/rally_verify.py | 16 +++++++++++++++- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/etc/rally.bash_completion b/etc/rally.bash_completion index 3cc70b8f..b84eefb0 100644 --- a/etc/rally.bash_completion +++ b/etc/rally.bash_completion @@ -50,9 +50,9 @@ _rally() OPTS["verify_discover"]="--deployment --pattern" OPTS["verify_genconfig"]="--deployment --tempest-config --override" OPTS["verify_import"]="--deployment --set --file --no-use" - OPTS["verify_install"]="--deployment --source --system-wide" + OPTS["verify_install"]="--deployment --source --version --system-wide" OPTS["verify_list"]="" - OPTS["verify_reinstall"]="--deployment --source --system-wide" + OPTS["verify_reinstall"]="--deployment --source --version --system-wide" OPTS["verify_results"]="--uuid --html --json --output-file" OPTS["verify_show"]="--uuid --sort-by --detailed" OPTS["verify_showconfig"]="--deployment" @@ -87,4 +87,4 @@ _rally() return 0 } -complete -o filenames -F _rally rally +complete -o filenames -F _rally rally \ No newline at end of file diff --git a/tests/ci/rally_verify.py b/tests/ci/rally_verify.py index 2d516084..3aaa05e8 100755 --- a/tests/ci/rally_verify.py +++ b/tests/ci/rally_verify.py @@ -171,8 +171,22 @@ def main(): render_vars = {"verifications": []} - # Verification management stuff + # Install Tempest render_vars["install"] = call_rally("verify install") + + # Get Rally deployment ID + rally_deployment_id = subprocess.check_output( + "rally deployment list | awk '/devstack/ {print $2}'", + shell=True, stderr=subprocess.STDOUT) + # Get the penultimate Tempest commit ID + tempest_commit_id = subprocess.check_output( + "cd /home/jenkins/.rally/tempest/for-deployment-%s " + "git log --skip 1 -n 1 | awk '/commit/ {print $2}' | head -1" + % rally_deployment_id, shell=True, stderr=subprocess.STDOUT).strip() + # Reinstall Tempest with providing the --version arg to the command + render_vars["reinstall"] = call_rally( + "verify reinstall --version %s" % tempest_commit_id) + render_vars["genconfig"] = call_rally("verify genconfig") render_vars["showconfig"] = call_rally("verify showconfig")