From 3047f999ce5eb35c5502261678e72f52e5320326 Mon Sep 17 00:00:00 2001 From: Marcela Bonell Date: Mon, 26 Oct 2015 16:05:51 -0600 Subject: [PATCH] [Verify] New command to install Tempest plugins This command allows us to install a Tempest plugin from a repository. E.g. $ rally verify installplugin --source https://github.com/MBonell/hello-world-tempest-plugin $ rally verify installplugin --source /home/ubuntu/my-plugin Implements Blueprint: install-tempest-plugins Change-Id: I03ac6063b6b9d7f860379b99f3b524adedba6df9 --- etc/rally.bash_completion | 3 ++- tests/ci/rally_verify.py | 27 +++++++++++++++++---------- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/etc/rally.bash_completion b/etc/rally.bash_completion index 9d588e0f..e9b38d36 100644 --- a/etc/rally.bash_completion +++ b/etc/rally.bash_completion @@ -52,6 +52,7 @@ _rally() OPTS["verify_genconfig"]="--deployment --tempest-config --override" OPTS["verify_import"]="--deployment --set --file --no-use" OPTS["verify_install"]="--deployment --source --version --system-wide" + OPTS["verify_installplugin"]="--deployment --source --version --system-wide" OPTS["verify_list"]="" OPTS["verify_reinstall"]="--deployment --source --version --system-wide" OPTS["verify_results"]="--uuid --html --json --output-file" @@ -88,4 +89,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 3789b7b4..ad5ca54e 100755 --- a/tests/ci/rally_verify.py +++ b/tests/ci/rally_verify.py @@ -46,6 +46,8 @@ EXPECTED_FAILURES = { "This test fails because 'novnc' console type is unavailable." } +TEMPEST_PLUGIN = "https://github.com/MBonell/hello-world-tempest-plugin" + # NOTE(andreykurilin): this variable is used to generate output file names # with prefix ${CALL_COUNT}_ . _call_count = 0 @@ -62,10 +64,10 @@ def call_rally(cmd, print_output=False, output_type=None): data = {"cmd": "rally --rally-debug %s" % cmd} stdout_file = "{base}/{prefix}_{cmd}.txt.gz" - if "--xfails-file" in cmd: + if "--xfails-file" in cmd or "--source" in cmd: cmd_items = cmd.split() for num, item in enumerate(cmd_items): - if EXPECTED_FAILURES_FILE in item: + if EXPECTED_FAILURES_FILE in item or TEMPEST_PLUGIN in item: cmd_items[num] = os.path.basename(item) break cmd = " ".join(cmd_items) @@ -233,15 +235,9 @@ def main(): render_vars = {"verifications": []} - # Install Tempest + # Install the latest Tempest version render_vars["install"] = call_rally("verify install") - # Discover tests depending on Tempest suite - discover_cmd = "verify discover" - if args.mode == "light": - discover_cmd += " --pattern smoke" - render_vars["discover"] = call_rally(discover_cmd) - # Get Rally deployment ID rally_deployment_id = subprocess.check_output( "rally deployment list | awk '/devstack/ {print $2}'", @@ -251,10 +247,21 @@ def main(): "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 + # Install the penultimate Tempest version render_vars["reinstall"] = call_rally( "verify reinstall --version %s" % tempest_commit_id) + # Install a simple Tempest plugin + render_vars["installplugin"] = call_rally( + "verify installplugin --source %s" % TEMPEST_PLUGIN) + + # Discover tests depending on Tempest suite + discover_cmd = "verify discover" + if args.mode == "light": + discover_cmd += " --pattern smoke" + render_vars["discover"] = call_rally(discover_cmd) + + # Generate and show Tempest config file render_vars["genconfig"] = call_rally("verify genconfig") render_vars["showconfig"] = call_rally("verify showconfig")