~cjwatson/launchpad-buildd/better-snap-channel-handling-2

« back to all changes in this revision

Viewing changes to lpbuildd/target/tests/test_lifecycle.py

  • Committer: Colin Watson
  • Date: 2019-02-07 11:09:40 UTC
  • mfrom: (353.3.2 image-type)
  • Revision ID: cjwatson@canonical.com-20190207110940-fays8acwsszhj338
[r=wgrant] Allow the LXD backend to accept a LXD image instead of a chroot tarball, skipping the conversion step.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
        create = parse_args(args=args).operation
25
25
        self.assertEqual(0, create.run())
26
26
        self.assertEqual(
27
 
            [(("/path/to/tarball",), {})], create.backend.create.calls)
 
27
            [(("/path/to/tarball", "chroot"), {})],
 
28
            create.backend.create.calls)
 
29
 
 
30
    def test_image_type(self):
 
31
        args = [
 
32
            "unpack-chroot",
 
33
            "--backend=fake", "--series=xenial", "--arch=amd64", "1",
 
34
            "--image-type", "lxd", "/path/to/tarball",
 
35
            ]
 
36
        create = parse_args(args=args).operation
 
37
        self.assertEqual(0, create.run())
 
38
        self.assertEqual(
 
39
            [(("/path/to/tarball", "lxd"), {})],
 
40
            create.backend.create.calls)
28
41
 
29
42
 
30
43
class TestStart(TestCase):