Exemple #1
0
    def test_inject_net(self):

        vfs = vfsguestfs.VFSGuestFS("/some/file", "qcow2")
        vfs.setup()

        diskapi._inject_net_into_fs("mynetconfig", vfs)

        self.assertTrue("/etc/network/interfaces" in vfs.handle.files)
        self.assertEquals(
            vfs.handle.files["/etc/network/interfaces"],
            {"content": "mynetconfig", "gid": 100, "isdir": False, "mode": 0700, "uid": 100},
        )
Exemple #2
0
    def test_inject_net(self):

        vfs = vfsguestfs.VFSGuestFS("/some/file", "qcow2")
        vfs.setup()

        diskapi._inject_net_into_fs("mynetconfig", vfs)

        self.assertTrue("/etc/network/interfaces" in vfs.handle.files)
        self.assertEquals(vfs.handle.files["/etc/network/interfaces"],
                          {'content': 'mynetconfig',
                           'gid': 100,
                           'isdir': False,
                           'mode': 0700,
                           'uid': 100})
Exemple #3
0
    def test_inject_net(self):

        vfs = vfsguestfs.VFSGuestFS("/some/file", "qcow2")
        vfs.setup()

        diskapi._inject_net_into_fs("mynetconfig", vfs)

        self.assertTrue("/etc/network/interfaces" in vfs.handle.files)
        self.assertEquals(vfs.handle.files["/etc/network/interfaces"],
                          {'content': 'mynetconfig',
                           'gid': 100,
                           'isdir': False,
                           'mode': 0700,
                           'uid': 100})
    def test_inject_net(self):

        vfs = vfsguestfs.VFSGuestFS(self.file)
        vfs.setup()

        diskapi._inject_net_into_fs("mynetconfig", vfs)

        self.assertIn("/etc/network/interfaces", vfs.handle.files)
        self.assertEqual(vfs.handle.files["/etc/network/interfaces"],
                         {'content': 'mynetconfig',
                          'gid': 100,
                          'isdir': False,
                          'mode': 0o700,
                          'uid': 100})
        vfs.teardown()
    def test_inject_net(self):

        vfs = vfsguestfs.VFSGuestFS(self.file)
        vfs.setup()

        def emulate_old_inject_behavior(guest_os_info):
            return [('/etc/network/interfaces', 'mynetconfig')]

        diskapi._inject_net_into_fs(emulate_old_inject_behavior, vfs)

        self.assertIn("/etc/network/interfaces", vfs.handle.files)
        self.assertEqual(vfs.handle.files["/etc/network/interfaces"],
                         {'content': 'mynetconfig',
                          'gid': 100,
                          'isdir': False,
                          'mode': 0o700,
                          'uid': 100})
        vfs.teardown()