def setUp(self): super(TestAutoLogin, self).setUp() factory = Factory() self.job = factory.create_kvm_job('sample_jobs/kvm-inline.yaml', mkdtemp()) self.job.logger = DummyLogger() self.max_end_time = time.time() + 30
def test_basic_actions(self): factory = Factory() job = factory.create_fake_qemu_job(mkdtemp()) if not job: return unittest.skip("not all deployments have been implemented") self.assertIsInstance(job, Job) self.assertIsInstance(job.pipeline, Pipeline)
def setUp(self): super(TestDefinitionHandlers, self).setUp() factory = Factory() self.job = factory.create_kvm_job('sample_jobs/kvm.yaml') with open( os.path.join(os.path.dirname(__file__), 'testdefs', 'params.yaml'), 'r') as params: self.testdef = yaml.safe_load(params)
def setUp(self): """ Attempt to setup a valid group with clients and test the protocol """ super(TestMultinode, self).setUp() factory = Factory() self.client_job = factory.create_kvm_job('sample_jobs/kvm-multinode-client.yaml') self.server_job = factory.create_kvm_job('sample_jobs/kvm-multinode-server.yaml') self.coord = TestCoordinator()
def test_qemu_notest(self): factory = Factory() job = factory.create_kvm_job('sample_jobs/kvm-notest.yaml', mkdtemp()) job.validate() self.assertIsNotNone(job) self.assertIsNotNone(job.pipeline) self.assertIsNotNone(job.pipeline.actions) for action in job.pipeline.actions: action.validate() self.assertTrue(action.valid) self.assertTrue(find_autologin(job))
def test_qemu_monitor_zephyr_job(self): factory = Factory() job = factory.create_kvm_job('sample_jobs/zephyr-qemu-test-task.yaml', mkdtemp()) job.validate() self.assertIsNotNone(job) self.assertIsNotNone(job.pipeline) self.assertIsNotNone(job.pipeline.actions) for action in job.pipeline.actions: action.validate() self.assertTrue(action.valid) self.assertFalse(find_autologin(job))
def setUp(self): super(TestPatterns, self).setUp() self.testdef = os.path.join(os.path.dirname(__file__), 'testdefs', 'params.yaml') self.res_data = os.path.join(os.path.dirname(__file__), 'testdefs', 'result-data.txt') factory = Factory() self.job = factory.create_kvm_job("sample_jobs/kvm.yaml") self.job.logger = DummyLogger() self.job.validate() self.ret = False test_retry = [action for action in self.job.pipeline.actions if action.name == 'lava-test-retry'][0] self.test_shell = [action for action in test_retry.internal_pipeline.actions if action.name == 'lava-test-shell'][0] self.test_shell.logger = DummyLogger()
def setUp(self): super(TestDefinitionSimple, self).setUp() factory = Factory() self.job = factory.create_kvm_job('sample_jobs/kvm-notest.yaml')
def setUp(self): super(TestKVMInlineTestDeploy, self).setUp() factory = Factory() self.job = factory.create_kvm_job('sample_jobs/kvm-inline.yaml', mkdtemp())
def test_autologin_normal_kvm(self): factory = Factory() job = factory.create_kvm_job('sample_jobs/kvm.yaml', mkdtemp()) job.validate() self.assertTrue(find_autologin(job))
def setUp(self): super(TestKVMQcow2Deploy, self).setUp() factory = Factory() self.job = factory.create_kvm_job('sample_jobs/kvm-qcow2.yaml', mkdtemp())
def setUp(self): super(TestKVMDownloadLocalDeploy, self).setUp() factory = Factory() self.job = factory.create_kvm_job('sample_jobs/kvm-local.yaml', mkdtemp())
def setUp(self): super(TestCommand, self).setUp() factory = Factory() self.job = factory.create_kvm_job('sample_jobs/kvm-command.yaml', mkdtemp())
def setUp(self): super(TestMonitor, self).setUp() factory = Factory() self.job = factory.create_kvm_job('sample_jobs/qemu-monitor.yaml', mkdtemp())
def test_basic_actions(self): factory = Factory() job = factory.create_fake_qemu_job() self.assertIsInstance(job, Job) self.assertIsInstance(job.pipeline, Pipeline)
def setUp(self): super(TestKvmUefi, self).setUp() factory = Factory() self.job = factory.create_kvm_job('sample_jobs/kvm-uefi.yaml', mkdtemp())
def test_kvm_simulation(self): # pylint: disable=too-many-statements """ Build a pipeline which simulates a KVM LAVA job without using the formal objects (to avoid validating data known to be broken). The details are entirely arbitrary. """ factory = Factory() job = factory.create_kvm_job('sample_jobs/kvm.yaml') pipe = Pipeline() action = Action() action.name = "deploy_linaro_image" action.description = "deploy action using preset subactions in an internal pipe" action.summary = "deploy_linaro_image" action.job = job # deliberately unlikely location # a successful validation would need to use the cwd action.parameters = { "image": "file:///none/images/bad-kvm-debian-wheezy.img" } pipe.add_action(action) self.assertEqual(action.level, "1") deploy_pipe = Pipeline(action) action = Action() action.name = "downloader" action.description = "download image wrapper, including an internal retry pipe" action.summary = "downloader" action.job = job deploy_pipe.add_action(action) self.assertEqual(action.level, "1.1") # a formal RetryAction would contain a pre-built pipeline which can be inserted directly retry_pipe = Pipeline(action) action = Action() action.name = "wget" action.description = "do the download with retries" action.summary = "wget" action.job = job retry_pipe.add_action(action) self.assertEqual(action.level, "1.1.1") action = Action() action.name = "checksum" action.description = "checksum the downloaded file" action.summary = "md5sum" action.job = job deploy_pipe.add_action(action) self.assertEqual(action.level, "1.2") action = Action() action.name = "overlay" action.description = "apply lava overlay" action.summary = "overlay" action.job = job deploy_pipe.add_action(action) self.assertEqual(action.level, "1.3") action = Action() action.name = "boot" action.description = "boot image" action.summary = "qemu" action.job = job # cmd_line built from device configuration action.parameters = { 'cmd_line': [ 'qemu-system-x86_64', '-machine accel=kvm:tcg', '-hda' '%s' % "tbd", '-nographic', '-net', 'nic,model=virtio' '-net user' ] } pipe.add_action(action) self.assertEqual(action.level, "2") action = Action() action.name = "simulated" action.description = "lava test shell" action.summary = "simulated" action.job = job # a formal lava test shell action would include an internal pipe # which would handle the run.sh pipe.add_action(action) self.assertEqual(action.level, "3") # just a fake action action = Action() action.name = "fake" action.description = "faking results" action.summary = "fake action" action.job = job pipe.add_action(action) self.assertEqual(action.level, "4") self.assertEqual(len(pipe.describe()), 4)
def setUp(self): super(TestDefinitionHandlers, self).setUp() factory = Factory() self.job = factory.create_kvm_job('sample_jobs/kvm.yaml')
def setUp(self): super(TestRepeatBootTest, self).setUp() factory = Factory() self.job = factory.create_kvm_job('sample_jobs/kvm-repeat.yaml', mkdtemp())
def setUp(self): super(TestChecksum, self).setUp() factory = Factory() self.job = factory.create_kvm_job('sample_jobs/kvm-inline.yaml', mkdtemp())
def setUp(self): super(TestDefinitionParams, self).setUp() self.factory = Factory() self.job = self.factory.create_kvm_job('sample_jobs/kvm-params.yaml')
def setUp(self): super(TestDefinitionRepeat, self).setUp() factory = Factory() self.job = factory.create_kvm_job("sample_jobs/kvm-multi.yaml")
def setUp(self): super(TestKVMBasicDeploy, self).setUp() factory = Factory() self.job = factory.create_job('sample_jobs/kvm.yaml', self.config_dir)