Exemple #1
0
 def test_filesystem_list_empty(self):
     """
     Test listing an non-existent filesystem.
     """
     result = StratisDbus.fs_list()
     self.assertIsInstance(result, dict)
     self.assertEqual(result, {})
Exemple #2
0
    def test_pool_destroy(self):
        """
        Test destroying a pool.
        """
        pool_name = p_n()
        make_test_pool(pool_name, StratisCertify.DISKS[0:1])

        self._unittest_command(StratisDbus.pool_destroy(pool_name), dbus.UInt16(0))

        self.assertEqual(StratisDbus.fs_list(), {})
Exemple #3
0
    def test_filesystem_list_not_empty(self):
        """
        Test listing an existent filesystem.
        """
        pool_name = p_n()
        pool_path = make_test_pool(pool_name, StratisCertify.DISKS[0:1])

        fs_name = fs_n()
        make_test_filesystem(pool_path, fs_name)

        self._inequality_test(StratisDbus.fs_list(), {})
Exemple #4
0
    def test_pool_destroy(self):
        """
        Test destroying a pool.
        """
        pool_name = p_n()
        make_test_pool(pool_name, DISKS[0:1])

        (_, return_code, _) = StratisDbus.pool_destroy(pool_name)
        self.assertEqual(return_code, dbus.UInt16(0))

        self.assertEqual(StratisDbus.fs_list(), {})
Exemple #5
0
    def test_filesystem_list_not_empty(self):
        """
        Test listing an existent filesystem.
        """
        pool_name = p_n()
        pool_path = make_test_pool(pool_name, DISKS[0:1])

        fs_name = fs_n()
        make_test_filesystem(pool_path, fs_name)

        result = StratisDbus.fs_list()
        self.assertIsInstance(result, dict)
        self.assertNotEqual(result, {})
Exemple #6
0
    def test_filesystem_destroy(self):
        """
        Test destroying a filesystem.
        """
        pool_name = p_n()
        pool_path = make_test_pool(pool_name, StratisCertify.DISKS[0:1])

        fs_name = fs_n()
        make_test_filesystem(pool_path, fs_name)

        self._unittest_command(StratisDbus.fs_destroy(pool_name, fs_name),
                               dbus.UInt16(0))

        self.assertEqual(StratisDbus.fs_list(), {})
Exemple #7
0
    def test_filesystem_destroy(self):
        """
        Test destroying a filesystem.
        """
        pool_name = p_n()
        pool_path = make_test_pool(pool_name, DISKS[0:1])

        fs_name = fs_n()
        make_test_filesystem(pool_path, fs_name)

        (_, return_code, _) = StratisDbus.fs_destroy(pool_name, fs_name)
        self.assertEqual(return_code, dbus.UInt16(0))

        self.assertEqual(StratisDbus.fs_list(), {})