Example #1
0
    def test_basic(self):
        from sh import imgbase, touch

        # All subsequent imgbase calls include the debug arg
        imgbase = imgbase.bake("--debug")

        assert "Image-0.0" in imgbase.layout()
        assert "Image-0.1" in imgbase.layout()

        log(imgbase.layer("--add"))
        assert "Image-0.2" in imgbase.layer("--latest")

        touch("/root/marker")
        touch("/var/tmp/marker")
        diff = imgbase("--debug", "diff", "Image-0.1", "Image-0.2")
        print(diff)
        assert "/root/marker" in diff
        assert "/var/tmp/marker" not in diff
Example #2
0
    def test_imgbase(self):
        from sh import imgbase, lvm

        # All subsequent imgbase calls include the debug arg
        imgbase = imgbase.bake("--debug")

        log("Using %s" % imgbase)
        log(imgbase("--version"))

        log("Existing LVM layout")
        log(lvm.pvs())
        log(lvm.vgs())
        log(lvm.lvs())

        assert "HostVG" in lvm.vgs()

        assert "Image-0.0" in imgbase.layout()

        # Check that a current layer exists
        imgbase.layer("--current")
Example #3
0
    def test_imgbase(self):
        from sh import imgbase, lvm

        # All subsequent imgbase calls include the debug arg
        imgbase = imgbase.bake("--debug")

        log("Using %s" % imgbase)
        log(imgbase("--version"))

        log("Existing LVM layout")
        log(lvm.pvs())
        log(lvm.vgs())
        log(lvm.lvs())

        assert "HostVG" in lvm.vgs()

        assert "Image-0.0" in imgbase.layout()

        # Check that a current layer exists
        imgbase.layer("--current")