Exemplo n.º 1
0
    def test_get_account_backups(self):
        # this can be reverted to set_bodiless_matcher() after tests are re-recorded and don't contain these headers
        set_custom_default_matcher(
            compare_bodies=False,
            excluded_headers=
            "Authorization,Content-Length,x-ms-client-request-id,x-ms-request-id"
        )
        create_backup(self.client,
                      backup_name=TEST_BACKUP_1,
                      live=self.is_live)

        account_backup = self.client.account_backups.get(
            TEST_RG, TEST_ACC_1, TEST_BACKUP_1)
        assert account_backup.name == TEST_ACC_1 + "/" + TEST_BACKUP_1

        disable_backup(self.client, TEST_BACKUP_1, live=self.is_live)
        delete_volume(self.client,
                      TEST_RG,
                      TEST_ACC_1,
                      TEST_POOL_1,
                      TEST_VOL_1,
                      live=self.is_live)
        delete_pool(self.client,
                    TEST_RG,
                    TEST_ACC_1,
                    TEST_POOL_1,
                    live=self.is_live)
        delete_account(self.client, TEST_RG, TEST_ACC_1, live=self.is_live)
Exemplo n.º 2
0
    def test_list_account_backups(self):
        # this can be reverted to set_bodiless_matcher() after tests are re-recorded and don't contain these headers
        set_custom_default_matcher(
            compare_bodies=False,
            excluded_headers=
            "Authorization,Content-Length,x-ms-client-request-id,x-ms-request-id"
        )
        create_backup(self.client,
                      backup_name=TEST_BACKUP_1,
                      live=self.is_live)
        create_backup(self.client,
                      backup_name=TEST_BACKUP_2,
                      backup_only=True,
                      live=self.is_live)

        account_backup_list = self.client.account_backups.list(
            TEST_RG, TEST_ACC_1)
        backup_count = 0
        for backup in account_backup_list:
            if TEST_BACKUP_1 in backup.name or TEST_BACKUP_2 in backup.name:
                backup_count += 1

        assert backup_count == 2

        disable_backup(self.client, live=self.is_live)
        disable_backup(self.client,
                       backup_name=TEST_BACKUP_2,
                       live=self.is_live)

        account_backup_list = self.client.account_backups.list(
            TEST_RG, TEST_ACC_1)
        backup_count = 0
        for backup in account_backup_list:
            if TEST_BACKUP_1 in backup.name or TEST_BACKUP_2 in backup.name:
                backup_count += 1

        assert backup_count == 0

        delete_volume(self.client,
                      TEST_RG,
                      TEST_ACC_1,
                      TEST_POOL_1,
                      TEST_VOL_1,
                      live=self.is_live)
        delete_pool(self.client,
                    TEST_RG,
                    TEST_ACC_1,
                    TEST_POOL_1,
                    live=self.is_live)
        delete_account(self.client, TEST_RG, TEST_ACC_1, live=self.is_live)
Exemplo n.º 3
0
    def test_list_account_backups(self):
        create_backup(self.client,
                      backup_name=TEST_BACKUP_1,
                      live=self.is_live)
        create_backup(self.client,
                      backup_name=TEST_BACKUP_2,
                      backup_only=True,
                      live=self.is_live)

        account_backup_list = self.client.account_backups.list(
            BACKUP_RG, TEST_ACC_1)
        backup_count = 0
        for backup in account_backup_list:
            if TEST_BACKUP_1 in backup.name or TEST_BACKUP_2 in backup.name:
                backup_count += 1

        self.assertEqual(backup_count, 2)

        disable_backup(self.client, live=self.is_live)
        disable_backup(self.client,
                       backup_name=TEST_BACKUP_2,
                       live=self.is_live)

        account_backup_list = self.client.account_backups.list(
            BACKUP_RG, TEST_ACC_1)
        backup_count = 0
        for backup in account_backup_list:
            if TEST_BACKUP_1 in backup.name or TEST_BACKUP_2 in backup.name:
                backup_count += 1

        self.assertEqual(backup_count, 0)

        delete_volume(self.client,
                      BACKUP_RG,
                      TEST_ACC_1,
                      TEST_POOL_1,
                      TEST_VOL_1,
                      live=self.is_live)
        delete_pool(self.client,
                    BACKUP_RG,
                    TEST_ACC_1,
                    TEST_POOL_1,
                    live=self.is_live)
        delete_account(self.client, BACKUP_RG, TEST_ACC_1, live=self.is_live)
Exemplo n.º 4
0
    def test_get_account_backups(self):
        create_backup(self.client,
                      backup_name=TEST_BACKUP_1,
                      live=self.is_live)

        account_backup = self.client.account_backups.get(
            BACKUP_RG, TEST_ACC_1, TEST_BACKUP_1)
        self.assertEqual(account_backup.name, TEST_ACC_1 + "/" + TEST_BACKUP_1)

        disable_backup(self.client, TEST_BACKUP_1, live=self.is_live)
        delete_volume(self.client,
                      BACKUP_RG,
                      TEST_ACC_1,
                      TEST_POOL_1,
                      TEST_VOL_1,
                      live=self.is_live)
        delete_pool(self.client,
                    BACKUP_RG,
                    TEST_ACC_1,
                    TEST_POOL_1,
                    live=self.is_live)
        delete_account(self.client, BACKUP_RG, TEST_ACC_1, live=self.is_live)