diff options
Diffstat (limited to 'lava_scheduler_app/tests')
-rw-r--r-- | lava_scheduler_app/tests/lxc-multinode.yaml | 59 | ||||
-rw-r--r-- | lava_scheduler_app/tests/test_pipeline.py | 21 |
2 files changed, 80 insertions, 0 deletions
diff --git a/lava_scheduler_app/tests/lxc-multinode.yaml b/lava_scheduler_app/tests/lxc-multinode.yaml new file mode 100644 index 000000000..77bf96d45 --- /dev/null +++ b/lava_scheduler_app/tests/lxc-multinode.yaml @@ -0,0 +1,59 @@ +device_type: lxc +job_name: lxc-pipeline +timeouts: + job: + minutes: 15 + action: + minutes: 5 +priority: medium +visibility: public +visibility: public + +protocols: + lava-multinode: + roles: + client: + count: 1 + device_type: lxc + server: + count: 1 + device_type: qemu + lava-lxc: + client: + name: pipeline-lxc-test + template: debian + distribution: debian + release: sid + arch: amd64 + mirror: http://ftp.us.debian.org/debian/ + security_mirror: http://mirror.csclub.uwaterloo.ca/debian-security/ + +actions: +- deploy: + timeout: + minutes: 5 + role: + - client + to: lxc + os: debian + +- boot: + role: + - client + prompts: + - 'root@(.*):/#' + timeout: + minutes: 5 + method: lxc + +- test: + role: + - client + - server + timeout: + minutes: 5 + definitions: + - repository: git://git.linaro.org/qa/test-definitions.git + from: git + path: common/dmidecode.yaml + name: dmidecode diff --git a/lava_scheduler_app/tests/test_pipeline.py b/lava_scheduler_app/tests/test_pipeline.py index 7e9cc0664..243729eaf 100644 --- a/lava_scheduler_app/tests/test_pipeline.py +++ b/lava_scheduler_app/tests/test_pipeline.py @@ -698,6 +698,27 @@ class TestYamlMultinode(TestCaseWithFactory): else: self.fail('unexpected role') + def test_multinode_lxc(self): + submission = yaml.load(open( + os.path.join(os.path.dirname(__file__), 'lxc-multinode.yaml'), 'r')) + target_group = 'arbitrary-group-id' # for unit tests only + + jobs = split_multinode_yaml(submission, target_group) + protocol_data = { + 'lava-lxc': { + 'name': 'pipeline-lxc-test', 'template': 'debian', + 'security_mirror': 'http://mirror.csclub.uwaterloo.ca/debian-security/', 'release': 'sid', + 'distribution': 'debian', 'mirror': 'http://ftp.us.debian.org/debian/', 'arch': 'amd64'} + } + for role, _ in jobs.iteritems(): + if role == 'server': + self.assertNotIn('lava-lxc', jobs[role][0]['protocols']) + elif role == 'client': + self.assertIn('lava-lxc', jobs[role][0]['protocols']) + self.assertEqual(jobs[role][0]['protocols']['lava-lxc'], protocol_data['lava-lxc']) + else: + self.fail('Unrecognised role: %s' % role) + def test_multinode_protocols(self): user = self.factory.make_user() device_type = self.factory.make_device_type() |