Example #1
0
 def test_bad_testpackage_names(self):
     options = Options()
     options.packages = "test-definition-tests thisisnotatestpackage"
     options.timeout = 1
     tid = SystemTest(self).run(options).verify(Result.ERROR).id()
     assert_log_page_contains_messages(self, tid, [
         "Invalid testpackage(s): thisisnotatestpackage"])
Example #2
0
 def test_hw_based_testrun_with_test_definition_tests_using_libssh2(self):
     options = Options()
     options.use_libssh2 = True
     tid = SystemTest(self).run(options).verify(Result.PASS).id()
     assert_log_page_contains_messages(
         self, tid, ["Environment: Hardware", "Starting conductor at", "-t %s -m 1800 --libssh2" % options.packages]
     )
Example #3
0
 def test_no_image_url(self):
     options = Options()
     options.timeout = 1
     options.image = ""
     tid = SystemTest(self).run(options).verify(Result.ERROR).id()
     assert_log_page_contains_messages(self, tid, [
         "Missing `image` parameter"])
Example #4
0
 def test_bad_distribution_model(self):
     options = Options()
     options.distribution_model = "sendalltestrunstowastebin"
     options.timeout = 1
     tid = SystemTest(self).run(options).verify(Result.ERROR).id()
     assert_log_page_contains_messages(self, tid, [
         "Invalid distribution model: sendalltestrunstowastebin"])
Example #5
0
 def test_load_invalid_distribution_model(self):
     options = Options()
     options.distribution_model = "invalid_distribution_model"
     options.timeout = 1
     tid = SystemTest(self).run(options).verify(Result.ERROR).id()
     assert_log_page_contains_messages(self, tid, [
         "ValueError: Invalid distribution model"])
Example #6
0
 def test_hw_and_host_based_testrun_with_test_definition_tests(self):
     options = Options()
     options.hosttest = "test-definition-tests"
     options.timeout = 60
     tid = SystemTest(self).run(options).verify(Result.PASS).id()
     assert_log_page_contains_messages(self, tid, [
         "Environment: Hardware",
         "Environment: Host_Hardware"])
Example #7
0
 def test_chroot_based_testrun_with_test_definition_tests(self):
     options = Options()
     options.rootstrap = CONFIG["rootstrap_url"]
     options.chroottest = "test-definition-tests"
     tid = SystemTest(self).run(options).verify(Result.PASS).id()
     assert_log_page_contains_messages(self, tid, [
         "Environment: chroot",
         "Testing in chroot done. No errors."])
Example #8
0
 def test_host_based_testrun_with_multiple_tests(self):
     options = Options()
     options.distribution_model = "default"
     options.hosttest = "test-definition-tests testrunner-lite-regression-tests"
     options.testfilter = "testcase=trlitereg01,Check-basic-schema"
     options.timeout = 60
     tid = SystemTest(self).run(options).verify(Result.PASS).id()
     assert_log_page_contains_messages(self, tid, ["Environment: Host_Hardware"])
Example #9
0
 def test_hw_based_testrun_with_test_definition_tests_using_libssh2(self):
     options = Options()
     options.use_libssh2 = True
     tid = SystemTest(self).run(options).verify(Result.PASS).id()
     assert_log_page_contains_messages(self, tid, [
         "Environment: Hardware",
         "Starting conductor at",
         "-t %s -m 1800 --libssh2" % options.packages])
Example #10
0
 def test_load_separated_settings(self):
     options = Options()
     options.hosttest = "test-definition-tests"
     options.sw_product = CONFIG["sw_product"]
     options.timeout = 60
     options.testfilter = "testcase=Check-basic-schema"
     tid = SystemTest(self).run(options).verify(Result.PASS).id()
     assert_log_page_contains_messages(self, tid, ["using config file /etc/ots/conductor_"])
Example #11
0
 def test_load_flasher_plugin(self):
     options = Options()
     options.hosttest = "test-definition-tests"
     options.sw_product = CONFIG["sw_product"]
     options.timeout = 60
     options.testfilter = "testcase=Check-basic-schema"
     tid = SystemTest(self).run(options).verify(Result.PASS).id()
     assert_log_page_contains_messages(self, tid, ["Loaded flasher 'meego-ai-flasher-n900'"])
Example #12
0
 def test_optimized_without_packages(self):
     options = Options()
     options.packages = ""
     options.distribution_model = "optimized"
     options.hw_testplans = ["data/echo_system_tests.xml"]
     options.sw_product = CONFIG["sw_product"]
     options.timeout = 10
     tid = SystemTest(self).run(options).verify(Result.ERROR).id()
     assert_log_page_contains_messages(self, tid, ["No commands created"])
Example #13
0
 def test_bad_image_url(self):
     options = Options()
     options.image = options.image + "asdfasdfthiswontexistasdfasdf"
     options.packages = "testrunner-lite-regression-tests"
     path = os.path.basename(options.image)
     tid = SystemTest(self).run(options).verify(Result.ERROR).id()
     assert_log_page_contains_messages(
         self, tid, ["Error: Could not download file %s, Error code: 103" % path, "Starting conductor at"]
     )
Example #14
0
 def test_chroot_based_testrun_with_multiple_tests(self):
     options = Options()
     options.distribution_model = "default"
     options.testfilter = "testcase=trlitereg01,Check-basic-schema"
     options.timeout = 60
     options.rootstrap = CONFIG["rootstrap_url"]
     options.chroottest = "test-definition-tests testrunner-lite-regression-tests"
     tid = SystemTest(self).run(options).verify(Result.PASS).id()
     assert_log_page_contains_messages(self, tid, ["Environment: chroot", "Testing in chroot done. No errors."])
Example #15
0
 def test_load_separated_settings(self):
     options = Options()
     options.hosttest = "test-definition-tests"
     options.sw_product = CONFIG["sw_product"]
     options.timeout = 60
     options.testfilter = "testcase=Check-basic-schema"
     tid = SystemTest(self).run(options).verify(Result.PASS).id()
     assert_log_page_contains_messages(self, tid, [
         "using config file /etc/ots/conductor_"])
Example #16
0
 def test_perpackage_distribution_no_packages(self):
     options = Options()
     options.packages = ""
     options.distribution_model = "perpackage"
     options.timeout = 1
     tid = SystemTest(self).run(options).verify(Result.ERROR).id()
     assert_log_page_contains_messages(self, tid, [
         "Test packages must be defined for specified " \
         "distribution model 'perpackage'"])
Example #17
0
 def test_load_flasher_plugin(self):
     options = Options()
     options.hosttest = "test-definition-tests"
     options.sw_product = CONFIG["sw_product"]
     options.timeout = 60
     options.testfilter = "testcase=Check-basic-schema"
     tid = SystemTest(self).run(options).verify(Result.PASS).id()
     assert_log_page_contains_messages(self, tid, [
         "Loaded flasher 'meego-ai-flasher-n900'"])
Example #18
0
 def test_perpackage_distribution_no_packages(self):
     options = Options()
     options.packages = ""
     options.distribution_model = "perpackage"
     options.timeout = 1
     tid = SystemTest(self).run(options).verify(Result.ERROR).id()
     assert_log_page_contains_messages(
         self, tid, ["Test packages must be defined for specified " "distribution model 'perpackage'"]
     )
Example #19
0
 def test_bad_image_url(self):
     options = Options()
     options.image = options.image+"asdfasdfthiswontexistasdfasdf"
     options.packages = "testrunner-lite-regression-tests"
     path = os.path.basename(options.image)
     tid = SystemTest(self).run(options).verify(Result.ERROR).id()
     assert_log_page_contains_messages(self, tid, [
         "Error: Could not download file %s, Error code: 103" % path,
         "Starting conductor at"])
Example #20
0
 def test_email_invalid_address(self):
     options = Options()
     options.sw_product = CONFIG["sw_product"]
     options.timeout = 1
     options.image = ""
     options.email = "invalid_email_address"
     tid = SystemTest(self).run(options).verify(Result.ERROR).id()
     assert_log_page_contains_messages(self, tid, [
         "Missing `image` parameter",
         "Error in sending mail to following addresses: ['invalid_email_address']"])
Example #21
0
 def test_host_based_testrun_with_multiple_tests(self):
     options = Options()
     options.distribution_model = "default"
     options.hosttest = \
         "test-definition-tests testrunner-lite-regression-tests"
     options.testfilter = "testcase=trlitereg01,Check-basic-schema"
     options.timeout = 60
     tid = SystemTest(self).run(options).verify(Result.PASS).id()
     assert_log_page_contains_messages(self, tid, [
         "Environment: Host_Hardware"])
Example #22
0
 def test_hw_host_chroot_based_testrun_with_test_definition_tests(self):
     options = Options()
     options.hosttest = "test-definition-tests"
     options.chroottest = "test-definition-tests"
     options.rootstrap = CONFIG["rootstrap_url"]
     options.timeout = 60
     tid = SystemTest(self).run(options).verify(Result.PASS).id()
     assert_log_page_contains_messages(
         self, tid, ["Environment: Hardware", "Environment: Host_Hardware", "Environment: chroot"]
     )
Example #23
0
 def test_timeout(self):
     options = Options()
     options.packages = "testrunner-lite-regression-tests"
     options.timeout = 1
     tid = SystemTest(self).run(options).verify(Result.ERROR).id()
     assert_log_page_contains_messages(self, tid, [
         "Error: Timeout while executing test package " \
         "testrunner-lite-regression-tests, Error code: 1091",
         "Test execution error: Timeout while executing test " \
         "package testrunner-lite-regression-tests"])
Example #24
0
 def test_optimized_without_packages(self):
     options = Options()
     options.packages = ""
     options.distribution_model = "optimized"
     options.hw_testplans = ["data/echo_system_tests.xml"]
     options.sw_product = CONFIG["sw_product"]
     options.timeout = 10
     tid = SystemTest(self).run(options).verify(Result.ERROR).id()
     assert_log_page_contains_messages(self, tid, [
         "No commands created"])
Example #25
0
 def test_host_based_testrun_with_testplan(self):
     options = Options()
     options.distribution_model = "default"
     options.host_testplans = ["data/echo_system_tests.xml"]
     options.sw_product = CONFIG["sw_product"]
     options.timeout = 60
     tid = SystemTest(self).run(options).verify(Result.PASS).id()
     assert_log_page_contains_messages(self, tid, [
         "Environment: Host_Hardware",
         "Beginning to execute test package: echo_system_tests.xml",
         "Executed 1 cases. Passed 1 Failed 0"])
Example #26
0
 def test_testrun_with_filter(self):
     options = Options()
     options.packages = "testrunner-lite-regression-tests"
     options.testfilter = "testcase=trlitereg01,trlitereg02"
     tid = SystemTest(self).run(options).verify(Result.PASS).id()
     assert_log_page_contains_messages(self, tid, [
         "Test case quoting_01 is filtered",
         "Test case quoting_01 is filtered",
         "Executed 2 cases. Passed 2 Failed 0"])
     assert_log_page_does_not_contain_messages(self, tid, [
         "Test case trlitereg01 is filtered",
         "Test case trlitereg02 is filtered"])
Example #27
0
 def test_chroot_based_testrun_with_multiple_tests(self):
     options = Options()
     options.distribution_model = "default"
     options.testfilter = "testcase=trlitereg01,Check-basic-schema"
     options.timeout = 60
     options.rootstrap = CONFIG["rootstrap_url"]
     options.chroottest = \
         "test-definition-tests testrunner-lite-regression-tests"
     tid = SystemTest(self).run(options).verify(Result.PASS).id()
     assert_log_page_contains_messages(self, tid, [
         "Environment: chroot",
         "Testing in chroot done. No errors."])
Example #28
0
 def test_plugins_loaded(self):
     options = Options()
     options.hosttest = "test-definition-tests"
     options.sw_product = CONFIG["sw_product"]
     options.timeout = 60
     options.testfilter = "testcase=Check-basic-schema"
     tid = SystemTest(self).run(options).verify(Result.PASS).id()
     assert_log_page_contains_messages(self, tid, [
         "Plugin: ots.plugin.conductor.richcore loaded",
         "history data saved",
         "Using smtp server",
         "Email sent"])
Example #29
0
 def test_plugins_loaded(self):
     options = Options()
     options.hosttest = "test-definition-tests"
     options.sw_product = CONFIG["sw_product"]
     options.timeout = 60
     options.testfilter = "testcase=Check-basic-schema"
     tid = SystemTest(self).run(options).verify(Result.PASS).id()
     assert_log_page_contains_messages(
         self,
         tid,
         ["Plugin: ots.plugin.conductor.richcore loaded", "history data saved", "Using smtp server", "Email sent"],
     )
Example #30
0
 def test_email_invalid_address(self):
     options = Options()
     options.sw_product = CONFIG["sw_product"]
     options.timeout = 1
     options.image = ""
     options.email = "invalid_email_address"
     tid = SystemTest(self).run(options).verify(Result.ERROR).id()
     assert_log_page_contains_messages(
         self,
         tid,
         ["Missing `image` parameter", "Error in sending mail to following addresses: ['invalid_email_address']"],
     )
Example #31
0
    def test_load_example_distribution_model(self):
        """
        test_load_example_distribution_model

        To make this case pass example distribution model needs to be
        installed. It can be found from examples directory.
        """
        options = Options()
        options.distribution_model = "example_model"
        options.timeout = 1
        tid = SystemTest(self).run(options).verify(Result.ERROR).id()
        assert_log_page_contains_messages(self, tid, ["Example distribution model not implemented"])
Example #32
0
 def test_timeout(self):
     options = Options()
     options.packages = "testrunner-lite-regression-tests"
     options.timeout = 1
     tid = SystemTest(self).run(options).verify(Result.ERROR).id()
     assert_log_page_contains_messages(
         self,
         tid,
         [
             "Error: Timeout while executing test package " "testrunner-lite-regression-tests, Error code: 1091",
             "Test execution error: Timeout while executing test " "package testrunner-lite-regression-tests",
         ],
     )
Example #33
0
 def test_load_optimized_distribution_model_for_hw_packages(self):
     options = Options()
     options.packages = "test-definition-tests testrunner-lite-regression-tests"
     options.distribution_model = "optimized"
     options.testfilter = "testcase=trlitereg01,Check-basic-schema"
     options.sw_product = CONFIG["sw_product"]
     options.timeout = 60
     tid = SystemTest(self).run(options).verify(Result.PASS).id()
     assert_log_page_contains_messages(self, tid, [
         "Beginning to execute test package: test-definition-tests",
         "Beginning to execute test package: testrunner-lite-regression-tests",
         "Loaded custom distribution model 'ots.plugin.history.distribution_model'",
         "Environment: Hardware"])
Example #34
0
    def test_load_example_distribution_model(self):
        """
        test_load_example_distribution_model

        To make this case pass example distribution model needs to be
        installed. It can be found from examples directory.
        """
        options = Options()
        options.distribution_model = "example_model"
        options.timeout = 1
        tid = SystemTest(self).run(options).verify(Result.ERROR).id()
        assert_log_page_contains_messages(self, tid, [
            "Example distribution model not implemented"])
Example #35
0
 def test_non_existing_sw_product(self):
     options = Options()
     options.sw_product = "this_should_not_exist"
     options.timeout = 1
     tid = SystemTest(self).run(options).verify(Result.ERROR).id()
     assert_log_page_contains_messages(self, tid, [
         "'this_should_not_exist' not found",
         "Incoming request: program: this_should_not_exist, request: %s, " \
         "notify_list: ['%s'], options: {"  % (CONFIG["build_id"],
                                               CONFIG["email"]),
         "'image': '%s'" % (CONFIG["image_url"]),
         "'distribution_model': 'default'",
         "'timeout': 1"])
Example #36
0
 def test_host_based_testrun_split_into_multiple_tasks(self):
     options = Options()
     options.distribution_model = "perpackage"
     options.hosttest = \
         "test-definition-tests testrunner-lite-regression-tests"
     options.testfilter = "testcase=trlitereg01,Check-basic-schema"
     options.timeout = 60
     tid = SystemTest(self).run(options).verify(Result.PASS).id()
     assert_log_page_contains_messages(self, tid, [
         "Testrun ID: __TESTRUN_ID__  Environment: Host_Hardware",
         "Beginning to execute test package: test-definition-tests",
         "Beginning to execute test package: testrunner-lite-regression-test",
         "Executed 1 cases. Passed 1 Failed 0"])
Example #37
0
 def test_chroot_based_testrun_split_into_multiple_tasks(self):
     options = Options()
     options.distribution_model = "perpackage"
     options.testfilter = "testcase=trlitereg01,Check-basic-schema"
     options.timeout = 60
     options.rootstrap = CONFIG["rootstrap_url"]
     options.chroottest = \
         "test-definition-tests testrunner-lite-regression-tests"
     tid = SystemTest(self).run(options).verify(Result.PASS).id()
     assert_log_page_contains_messages(self, tid, [
         "Testrun ID: __TESTRUN_ID__  Environment: chroot",
         "Beginning to execute test package: test-definition-tests",
         "Beginning to execute test package: testrunner-lite-regression-test",
         "Executed 1 cases. Passed 1 Failed 0",
         "Testing in chroot done. No errors."])
Example #38
0
 def test_host_and_hw_test_package_and_test_plan(self):
     options = Options()
     options.distribution_model = "default"
     options.hw_testplans = ["data/echo_system_tests.xml"]
     options.host_testplans = ["data/ls_system_tests.xml"]
     options.hosttest = "testrunner-lite-regression-tests"
     options.sw_product = CONFIG["sw_product"]
     options.timeout = 60
     tid = SystemTest(self).run(options).verify(Result.PASS).id()
     assert_log_page_contains_messages(self, tid, [
         "Environment: Host_Hardware",
         "Environment: Hardware",
         "Beginning to execute test package: ls_system_tests.xml",
         "Beginning to execute test package: echo_system_tests.xml",
         "Beginning to execute test package: test-definition-tests",
         "Beginning to execute test package: testrunner-lite-regression-tests"])
Example #39
0
 def test_host_based_testrun_with_testplan(self):
     options = Options()
     options.distribution_model = "default"
     options.host_testplans = ["data/echo_system_tests.xml"]
     options.sw_product = CONFIG["sw_product"]
     options.timeout = 60
     tid = SystemTest(self).run(options).verify(Result.PASS).id()
     assert_log_page_contains_messages(
         self,
         tid,
         [
             "Environment: Host_Hardware",
             "Beginning to execute test package: echo_system_tests.xml",
             "Executed 1 cases. Passed 1 Failed 0",
         ],
     )
Example #40
0
 def test_example_conductor_plugin(self):
     """
     Example conductor plugin from examples directory needs to be installed!
     """
     options = Options()
     options.hosttest = "test-definition-tests"
     options.sw_product = CONFIG["sw_product"]
     options.timeout = 60
     options.testfilter = "testcase=Check-basic-schema"
     tid = SystemTest(self).run(options).verify(Result.PASS).id()
     assert_log_page_contains_messages(self, tid, [
         "ExampleConductorPlugin before_testrun method called.",
         "ExampleConductorPlugin after_testrun method called.",
         "ExampleConductorPlugin set_target method called.",
         "ExampleConductorPlugin set_result_dir method called.",
         "ExampleConductorPlugin get_result_files method called."])
Example #41
0
 def test_host_based_testrun_split_into_multiple_tasks(self):
     options = Options()
     options.distribution_model = "perpackage"
     options.hosttest = "test-definition-tests testrunner-lite-regression-tests"
     options.testfilter = "testcase=trlitereg01,Check-basic-schema"
     options.timeout = 60
     tid = SystemTest(self).run(options).verify(Result.PASS).id()
     assert_log_page_contains_messages(
         self,
         tid,
         [
             "Testrun ID: __TESTRUN_ID__  Environment: Host_Hardware",
             "Beginning to execute test package: test-definition-tests",
             "Beginning to execute test package: testrunner-lite-regression-test",
             "Executed 1 cases. Passed 1 Failed 0",
         ],
     )
Example #42
0
 def test_hw_based_testrun_with_resume_continue(self):
     options = Options()
     options.distribution = "default"
     options.hw_testplans = ["data/shutdown_system_tests.xml"]
     options.sw_product = CONFIG["sw_product"]
     options.timeout = 60
     options.resume = True
     tid = SystemTest(self).run(options).verify(Result.FAIL).id()
     assert_log_page_contains_messages(self, tid, [
         "--resume=continue",
         "Environment: Hardware",
         "Beginning to execute test package: shutdown_system_tests.xml",
         "Executed 4 cases. Passed 2 Failed 2",
         "Finished test case echo-before-shutdown Result: PASS",
         "Finished test case shutdown Result: FAIL",
         "Finished test case echo-after-shutdown Result: FAIL",
         "Finished test case echo1 Result: PASS"])
Example #43
0
 def test_non_existing_sw_product(self):
     options = Options()
     options.sw_product = "this_should_not_exist"
     options.timeout = 1
     tid = SystemTest(self).run(options).verify(Result.ERROR).id()
     assert_log_page_contains_messages(
         self,
         tid,
         [
             "'this_should_not_exist' not found",
             "Incoming request: program: this_should_not_exist, request: %s, "
             "notify_list: ['%s'], options: {" % (CONFIG["build_id"], CONFIG["email"]),
             "'image': '%s'" % (CONFIG["image_url"]),
             "'distribution_model': 'default'",
             "'timeout': 1",
         ],
     )
Example #44
0
 def test_testrun_with_filter(self):
     options = Options()
     options.packages = "testrunner-lite-regression-tests"
     options.testfilter = "testcase=trlitereg01,trlitereg02"
     tid = SystemTest(self).run(options).verify(Result.PASS).id()
     assert_log_page_contains_messages(
         self,
         tid,
         [
             "Test case quoting_01 is filtered",
             "Test case quoting_01 is filtered",
             "Executed 2 cases. Passed 2 Failed 0",
         ],
     )
     assert_log_page_does_not_contain_messages(
         self, tid, ["Test case trlitereg01 is filtered", "Test case trlitereg02 is filtered"]
     )
Example #45
0
 def test_load_optimized_distribution_model_for_hw_packages(self):
     options = Options()
     options.packages = "test-definition-tests testrunner-lite-regression-tests"
     options.distribution_model = "optimized"
     options.testfilter = "testcase=trlitereg01,Check-basic-schema"
     options.sw_product = CONFIG["sw_product"]
     options.timeout = 60
     tid = SystemTest(self).run(options).verify(Result.PASS).id()
     assert_log_page_contains_messages(
         self,
         tid,
         [
             "Beginning to execute test package: test-definition-tests",
             "Beginning to execute test package: testrunner-lite-regression-tests",
             "Loaded custom distribution model 'ots.plugin.history.distribution_model'",
             "Environment: Hardware",
         ],
     )
Example #46
0
 def verify(self, expected_result):
     if expected_result == Result.ERROR:
         for id in self.testrun_ids:
             self._assert_result(expected_result, Result.ERROR)
             self.test.assertTrue(log_page_contains_errors(id),
                 "There should be errors in testrun %s." % testrun_log_url(id))
     elif expected_result == Result.FAIL:
         self._assert_result(expected_result, Result.FAIL)
     elif expected_result == Result.PASS:
         for id in self.testrun_ids:
             self._assert_result(expected_result, Result.PASS)
             assert_log_page_contains_messages(self.test, id, \
                                               COMMON_SUCCESS_MESSAGES)
             self.test.assertFalse(log_page_contains_errors(id), \
                                   "Found errors in log %s" % id)
     else:
         raise Exception('Unknown expected result \'%s\'. Actual result: %s'
                         % (expected_result, self.result))
     return self
Example #47
0
 def test_example_conductor_plugin(self):
     """
     Example conductor plugin from examples directory needs to be installed!
     """
     options = Options()
     options.hosttest = "test-definition-tests"
     options.sw_product = CONFIG["sw_product"]
     options.timeout = 60
     options.testfilter = "testcase=Check-basic-schema"
     tid = SystemTest(self).run(options).verify(Result.PASS).id()
     assert_log_page_contains_messages(
         self,
         tid,
         [
             "ExampleConductorPlugin before_testrun method called.",
             "ExampleConductorPlugin after_testrun method called.",
             "ExampleConductorPlugin set_target method called.",
             "ExampleConductorPlugin set_result_dir method called.",
             "ExampleConductorPlugin get_result_files method called.",
         ],
     )
Example #48
0
 def test_host_and_hw_test_package_and_test_plan(self):
     options = Options()
     options.distribution_model = "default"
     options.hw_testplans = ["data/echo_system_tests.xml"]
     options.host_testplans = ["data/ls_system_tests.xml"]
     options.hosttest = "testrunner-lite-regression-tests"
     options.sw_product = CONFIG["sw_product"]
     options.timeout = 60
     tid = SystemTest(self).run(options).verify(Result.PASS).id()
     assert_log_page_contains_messages(
         self,
         tid,
         [
             "Environment: Host_Hardware",
             "Environment: Hardware",
             "Beginning to execute test package: ls_system_tests.xml",
             "Beginning to execute test package: echo_system_tests.xml",
             "Beginning to execute test package: test-definition-tests",
             "Beginning to execute test package: testrunner-lite-regression-tests",
         ],
     )
Example #49
0
 def verify(self, expected_result):
     if expected_result == Result.ERROR:
         for id in self.testrun_ids:
             self._assert_result(expected_result, Result.ERROR)
             self.test.assertTrue(
                 log_page_contains_errors(id),
                 "There should be errors in testrun %s." %
                 testrun_log_url(id))
     elif expected_result == Result.FAIL:
         self._assert_result(expected_result, Result.FAIL)
     elif expected_result == Result.PASS:
         for id in self.testrun_ids:
             self._assert_result(expected_result, Result.PASS)
             assert_log_page_contains_messages(self.test, id, \
                                               COMMON_SUCCESS_MESSAGES)
             self.test.assertFalse(log_page_contains_errors(id), \
                                   "Found errors in log %s" % id)
     else:
         raise Exception(
             'Unknown expected result \'%s\'. Actual result: %s' %
             (expected_result, self.result))
     return self
Example #50
0
 def test_hw_based_testrun_with_resume_continue(self):
     options = Options()
     options.distribution = "default"
     options.hw_testplans = ["data/shutdown_system_tests.xml"]
     options.sw_product = CONFIG["sw_product"]
     options.timeout = 60
     options.resume = True
     tid = SystemTest(self).run(options).verify(Result.FAIL).id()
     assert_log_page_contains_messages(
         self,
         tid,
         [
             "--resume=continue",
             "Environment: Hardware",
             "Beginning to execute test package: shutdown_system_tests.xml",
             "Executed 4 cases. Passed 2 Failed 2",
             "Finished test case echo-before-shutdown Result: PASS",
             "Finished test case shutdown Result: FAIL",
             "Finished test case echo-after-shutdown Result: FAIL",
             "Finished test case echo1 Result: PASS",
         ],
     )
Example #51
0
 def test_hw_based_testrun_with_test_definition_tests(self):
     options = Options()
     tid = SystemTest(self).run(options).verify(Result.PASS).id()
     assert_log_page_contains_messages(self, tid, [
         "Environment: Hardware",
         "Testing in Hardware done. No errors."])
Example #52
0
 def test_hw_based_testrun_with_test_definition_tests(self):
     options = Options()
     tid = SystemTest(self).run(options).verify(Result.PASS).id()
     assert_log_page_contains_messages(self, tid, ["Environment: Hardware", "Testing in Hardware done. No errors."])
Example #53
0
 def test_chroot_based_testrun_with_test_definition_tests(self):
     options = Options()
     options.rootstrap = CONFIG["rootstrap_url"]
     options.chroottest = "test-definition-tests"
     tid = SystemTest(self).run(options).verify(Result.PASS).id()
     assert_log_page_contains_messages(self, tid, ["Environment: chroot", "Testing in chroot done. No errors."])
Example #54
0
 def test_load_invalid_distribution_model(self):
     options = Options()
     options.distribution_model = "invalid_distribution_model"
     options.timeout = 1
     tid = SystemTest(self).run(options).verify(Result.ERROR).id()
     assert_log_page_contains_messages(self, tid, ["ValueError: Invalid distribution model"])
Example #55
0
 def test_bad_testpackage_names(self):
     options = Options()
     options.packages = "test-definition-tests thisisnotatestpackage"
     options.timeout = 1
     tid = SystemTest(self).run(options).verify(Result.ERROR).id()
     assert_log_page_contains_messages(self, tid, ["Invalid testpackage(s): thisisnotatestpackage"])
Example #56
0
 def test_bad_distribution_model(self):
     options = Options()
     options.distribution_model = "sendalltestrunstowastebin"
     options.timeout = 1
     tid = SystemTest(self).run(options).verify(Result.ERROR).id()
     assert_log_page_contains_messages(self, tid, ["Invalid distribution model: sendalltestrunstowastebin"])
Example #57
0
 def test_no_image_url(self):
     options = Options()
     options.timeout = 1
     options.image = ""
     tid = SystemTest(self).run(options).verify(Result.ERROR).id()
     assert_log_page_contains_messages(self, tid, ["Missing `image` parameter"])