Ejemplo n.º 1
0
 def test_ls_helpers(self):
     volumes = self.get_testvols()
     self.assertEqual(len(volumes), self.vol_count)
     for v in volumes:
         metadata = vmdkops_admin.get_metadata(
             os.path.join(v['path'], v['filename']))
         self.assertNotEqual(None, metadata)
 def test_ls_helpers(self):
     volumes = self.get_testvols()
     self.assertEqual(len(volumes), self.vol_count)
     for v in volumes:
         metadata = vmdkops_admin.get_metadata(os.path.join(v['path'], v[
             'filename']))
         self.assertNotEqual(None, metadata)
    def test_set_access(self):
        volumes = self.get_testvols()
        self.assertEqual(len(volumes), self.vol_count)
        for v in volumes:
            access_opt = random.choice(kv.ACCESS_TYPES)
            # generate string like "testvol0@datastore1"
            vol_arg = '@'.join([v['filename'].replace('.vmdk', ''), v['datastore']])
            access_arg = 'access={}'.format(access_opt)
            set_ok = vmdk_ops.set_vol_opts(vol_arg, access_arg)
            self.assertTrue(set_ok)

            metadata = vmdkops_admin.get_metadata(os.path.join(v['path'], v[
                'filename']))
            self.assertNotEqual(None, metadata)

            curr_access = vmdkops_admin.get_access(metadata)
            self.assertEqual(access_opt, curr_access)
Ejemplo n.º 4
0
    def test_set_access(self):
        volumes = self.get_testvols()
        self.assertEqual(len(volumes), self.vol_count)
        for v in volumes:
            access_opt = random.choice(kv.ACCESS_TYPES)
            # generate string like "testvol0@datastore1"
            vol_arg = '@'.join([v['filename'].replace('.vmdk', ''), v['datastore']])
            access_arg = 'access={}'.format(access_opt)
            set_ok = vmdk_ops.set_vol_opts(vol_arg, access_arg)
            self.assertTrue(set_ok)

            metadata = vmdkops_admin.get_metadata(os.path.join(v['path'], v[
                'filename']))
            self.assertNotEqual(None, metadata)

            curr_access = vmdkops_admin.get_access(metadata)
            self.assertEqual(access_opt, curr_access)