コード例 #1
0
ファイル: test_aggregate.py プロジェクト: suneelb/nova
 def test_aggregate_get_by_host_with_key_from_db(self):
     ah1 = _create_aggregate_with_hosts(self.context,
                                        values={'name': 'fake_aggregate_1'},
                                        metadata={'goodkey': 'good'},
                                        hosts=['host.1.openstack.org'])
     _create_aggregate_with_hosts(self.context,
                                  values={'name': 'fake_aggregate_2'},
                                  hosts=['host.1.openstack.org'])
     rh1 = aggregate._get_by_host_from_db(self.context,
                                          'host.1.openstack.org',
                                          key='goodkey')
     self.assertEqual(1, len(rh1))
     self.assertEqual(ah1['id'], rh1[0]['id'])
コード例 #2
0
ファイル: test_aggregate.py プロジェクト: ryanlv01/nova
 def test_aggregate_get_by_host_from_db(self):
     _create_aggregate_with_hosts(self.context,
                                  values={'name': 'fake_aggregate_1'},
                                  hosts=['host.1.openstack.org'])
     _create_aggregate_with_hosts(self.context,
                                  values={'name': 'fake_aggregate_2'},
                                  hosts=['host.1.openstack.org'])
     _create_aggregate(self.context, values={'name': 'no_host_aggregate'})
     rh1 = aggregate._get_all_from_db(self.context)
     rh2 = aggregate._get_by_host_from_db(self.context,
                                          'host.1.openstack.org')
     self.assertEqual(3, len(rh1))
     self.assertEqual(2, len(rh2))
コード例 #3
0
ファイル: test_aggregate.py プロジェクト: newctech/nova
 def test_aggregate_get_by_host_from_db(self):
     _create_aggregate_with_hosts(self.context,
                                  values={'name': 'fake_aggregate_1'},
                                  hosts=['host.1.openstack.org'])
     _create_aggregate_with_hosts(self.context,
                                  values={'name': 'fake_aggregate_2'},
                                  hosts=['host.1.openstack.org'])
     _create_aggregate(self.context,
                       values={'name': 'no_host_aggregate'})
     rh1 = aggregate._get_all_from_db(self.context)
     rh2 = aggregate._get_by_host_from_db(self.context,
                                          'host.1.openstack.org')
     self.assertEqual(3, len(rh1))
     self.assertEqual(2, len(rh2))