Exemplo n.º 1
0
    def testNullMapping(self):
        """
        Test rename to same name.
        """
        (result, rc, _) = checked_call(
           Pool.SetName(self._pool_object, name=self._POOLNAME),
           PoolSpec.OUTPUT_SIGS[_PN.SetName]
        )

        self.assertEqual(rc, self._errors.OK)
        self.assertFalse(result)

        managed_objects = get_managed_objects(self._proxy)
        result = next(managed_objects.pools({'Name': self._POOLNAME}), None)
        self.assertIsNotNone(result)
        (pool, _) = result
        self.assertEqual(pool, self._pool_object_path)
Exemplo n.º 2
0
    def testNewName(self):
        """
        Test rename to new name.
        """
        new_name = "new"

        (result, rc, _) = checked_call(
           Pool.SetName(self._pool_object, name=new_name),
           PoolSpec.OUTPUT_SIGS[_PN.SetName]
        )

        self.assertTrue(result)
        self.assertEqual(rc, self._errors.OK)

        managed_objects = get_managed_objects(self._proxy)
        self.assertIsNone(
           next(managed_objects.pools({'Name': self._POOLNAME}), None)
        )
        result = next(managed_objects.pools({'Name': new_name}), None)
        self.assertIsNotNone(result)
        (pool, _) = result
        self.assertEqual(pool, self._pool_object_path)