Exemplo n.º 1
0
    def test_no_list_listings(self):
        """
        Test that commands that optionally take a list work both ways.
        :return: None
        """
        pool_name = p_n()
        fs_name = fs_n()
        StratisCli.pool_create(pool_name, block_devices=DISKS)
        StratisCli.fs_create(pool_name, fs_name)

        self.assertEqual(StratisCli.pool_list(), StratisCli.pool_list(False))
        self.assertEqual(StratisCli.fs_list(), StratisCli.fs_list(False))
        self.assertEqual(StratisCli.blockdev_list(),
                         StratisCli.blockdev_list(False))
Exemplo n.º 2
0
    def test_block_dev_list(self):
        """
        Test block device listing
        :return:
        """
        pool_name = p_n()
        StratisCli.pool_create(pool_name, [DISKS[0]])

        block_devs = StratisCli.blockdev_list()
        self.assertTrue(DISKS[0] in block_devs)
        self.assertEqual(1, len(block_devs))
        self.assertEqual(pool_name, block_devs[DISKS[0]]["POOL_NAME"])
Exemplo n.º 3
0
    def test_pool_add_cache(self):
        """
        Test adding cache to a pool
        :return: None
        """
        pool_name = p_n()
        StratisCli.pool_create(pool_name, [DISKS[0]])
        StratisCli.pool_add(pool_name, "add-cache", DISKS[1:])
        block_devs = StratisCli.blockdev_list()

        for d in DISKS:
            self.assertTrue(d in block_devs)