Example #1
0
    def test_share_filter_all_by_host_with_pools_multiple_hosts(self):
        shares = [[api.share_create(self.ctxt, {'host': value})
                   for value in ('foo', 'foo#pool0', 'foo', 'foo#pool1')]]

        api.share_create(self.ctxt, {'host': 'foobar'})
        self._assertEqualListsOfObjects(shares[0],
                                        api.share_get_all_by_host(
                                            self.ctxt, 'foo'),
                                        ignored_keys=['share_type',
                                                      'share_type_id',
                                                      'export_locations'])
Example #2
0
    def test_share_filter_by_host_with_pools(self):
        shares = [[db_api.share_create(self.ctxt, {'host': value})
                   for value in ('foo', 'foo#pool0')]]

        db_utils.create_share()
        self._assertEqualListsOfObjects(shares[0],
                                        db_api.share_get_all_by_host(
                                            self.ctxt, 'foo'),
                                        ignored_keys=['share_type',
                                                      'share_type_id',
                                                      'export_locations'])
Example #3
0
    def test_share_filter_all_by_host_with_pools_multiple_hosts(self):
        shares = [[
            api.share_create(self.ctxt, {'host': value})
            for value in ('foo', 'foo#pool0', 'foo', 'foo#pool1')
        ]]

        api.share_create(self.ctxt, {'host': 'foobar'})
        self._assertEqualListsOfObjects(
            shares[0],
            api.share_get_all_by_host(self.ctxt, 'foo'),
            ignored_keys=['share_type', 'share_type_id', 'export_locations'])