diff mbox

[OSSTEST,v13,02/24] ts-openstack-tempest: Run Tempest to check OpenStack

Message ID 20170725115759.21895-3-anthony.perard@citrix.com (mailing list archive)
State New, archived
Headers show

Commit Message

Anthony PERARD July 25, 2017, 11:57 a.m. UTC
This script runs the OpenStack integration test suite, Tempest.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 sg-run-job           |  1 +
 ts-openstack-tempest | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 66 insertions(+)
 create mode 100755 ts-openstack-tempest
diff mbox

Patch

diff --git a/sg-run-job b/sg-run-job
index 6092384..5f15821 100755
--- a/sg-run-job
+++ b/sg-run-job
@@ -632,6 +632,7 @@  proc run-job/test-rumprun {} {
 proc need-hosts/test-devstack {} { return host }
 proc run-job/test-devstack {} {
     run-ts . = ts-openstack-deploy + host
+    run-ts . = ts-openstack-tempest + host
 }
 
 if {[file exists sg-run-job-adhoc]} {
diff --git a/ts-openstack-tempest b/ts-openstack-tempest
new file mode 100755
index 0000000..82e9a71
--- /dev/null
+++ b/ts-openstack-tempest
@@ -0,0 +1,65 @@ 
+#!/usr/bin/perl
+# This is part of "osstest", an automated testing framework for Xen.
+# Copyright (C) 2016 Citrix Inc.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+use strict qw(vars);
+use Osstest;
+use Osstest::TestSupport;
+use Osstest::BuildSupport;
+
+tsreadconfig();
+our ($whhost) = @ARGV;
+$whhost ||= 'host';
+our $ho = selecthost($whhost);
+our $builddir = target_jobdir($ho);
+
+sub tempest() {
+    my @ignored_tests;
+    my $scenario = 'tempest.scenario';
+    my $volume_boot_pattern =
+        "$scenario.test_volume_boot_pattern.TestVolumeBootPattern";
+    my $shelve_instance = "$scenario.test_shelve_instance.TestShelveInstance";
+
+    # Ignore tests which try to boot a guest with /dev/vda as boot device name.
+    push @ignored_tests,
+        "^\Q$volume_boot_pattern.test_volume_boot_pattern\E";
+    push @ignored_tests,
+        "^\Q$volume_boot_pattern.test_create_ebs_image_and_check_boot\E";
+    push @ignored_tests,
+        "^\Q$shelve_instance.test_shelve_volume_backed_instance\E";
+
+    # Those tests access a volume through iSCSI. This does not work when both
+    # the server and client of iSCSI are on the same Xen host (both in dom0),
+    # Linux 4.0 is the first Linux to have a fix.
+    push @ignored_tests,
+        "^\Q${volume_boot_pattern}V2.test_volume_boot_pattern\E";
+    push @ignored_tests,
+        "^\Q${volume_boot_pattern}V2.test_create_ebs_image_and_check_boot\E";
+
+    # This regex below select the tests to run and exclude the ones marked as
+    # slow as well as the explicit tests listed above.  It is based on the one
+    # that can be found in tempest.git/tox.ini in the section [testenv:full].
+    my $ignored_tests = join("|", @ignored_tests);
+    my $regex = "(?!.*\\[.*\\bslow\\b.*\\]|$ignored_tests)".
+        "(^tempest\\.(api|scenario|thirdparty))";
+
+    target_cmd($ho, <<END, 7200);
+set -e
+$builddir/tempest/run_tempest.sh --virtual-env -- --concurrency=2 '$regex'
+END
+}
+
+tempest();