示例#1
0
 def test_create_lswitch_with_additional_tags(self):
     more_tags = [{"scope": "foo_scope", "tag": "foo_tag"}]
     result = nsp._process_base_create_lswitch_args(
         self.cluster, self.tenant_id, self.display_name, self.tz_config, tags=more_tags
     )
     expected = self.tags + more_tags
     self.assertEqual(expected, result[2])
示例#2
0
 def test_create_lswitch_with_neutron_net_id_as_arg(self):
     result = nsp._process_base_create_lswitch_args(self.cluster,
                                                    self.tenant_id,
                                                    self.display_name,
                                                    self.tz_config, 'foo')
     expected = self.tags + [{'scope': 'quantum_net_id', 'tag': 'foo'}]
     self.assertEqual(expected, result[2])
示例#3
0
 def test_create_lswitch_with_shared_as_arg(self):
     result = nsp._process_base_create_lswitch_args(
         self.cluster, self.tenant_id, self.display_name, self.tz_config, "foo", True
     )
     additional_tags = [{"scope": "quantum_net_id", "tag": "foo"}, {"scope": "shared", "tag": "true"}]
     expected = self.tags + additional_tags
     self.assertEqual(expected, result[2])
示例#4
0
 def test_create_lswitch_with_shared_as_kwarg(self):
     result = nsp._process_base_create_lswitch_args(self.cluster,
                                                    self.tenant_id,
                                                    self.display_name,
                                                    self.tz_config,
                                                    shared=True)
     expected = self.tags + [{'scope': 'shared', 'tag': 'true'}]
     self.assertEqual(expected, result[2])
示例#5
0
 def test_create_lswitch_with_basic_args(self):
     result = nsp._process_base_create_lswitch_args(self.cluster,
                                                    self.tenant_id,
                                                    self.display_name,
                                                    self.tz_config)
     self.assertEqual(self.display_name, result[0])
     self.assertEqual(self.tz_config, result[1])
     self.assertEqual(self.tags, result[2])
示例#6
0
 def test_create_lswitch_with_shared_as_kwarg(self):
     result = nsp._process_base_create_lswitch_args(self.cluster,
                                                    self.tenant_id,
                                                    self.display_name,
                                                    self.tz_config,
                                                    shared=True)
     expected = self.tags + [{'scope': 'shared', 'tag': 'true'}]
     self.assertEqual(expected, result[2])
示例#7
0
 def test_create_lswitch_with_neutron_net_id_as_arg(self):
     result = nsp._process_base_create_lswitch_args(self.cluster,
                                                    self.tenant_id,
                                                    self.display_name,
                                                    self.tz_config,
                                                    'foo')
     expected = self.tags + [{'scope': 'quantum_net_id', 'tag': 'foo'}]
     self.assertEqual(expected, result[2])
示例#8
0
 def test_create_lswitch_with_basic_args(self):
     result = nsp._process_base_create_lswitch_args(self.cluster,
                                                    self.tenant_id,
                                                    self.display_name,
                                                    self.tz_config)
     self.assertEqual(self.display_name, result[0])
     self.assertEqual(self.tz_config, result[1])
     self.assertEqual(self.tags, result[2])
示例#9
0
 def test_create_lswitch_with_shared_as_arg(self):
     result = nsp._process_base_create_lswitch_args(self.cluster, 'foo_id',
                                                    self.tenant_id,
                                                    self.display_name,
                                                    self.tz_config, True)
     additional_tags = [{'scope': 'shared', 'tag': 'true'}]
     expected = self.tags + additional_tags
     self.assertEqual(expected, result[2])
示例#10
0
 def test_create_lswitch_with_additional_tags(self):
     more_tags = [{'scope': 'foo_scope', 'tag': 'foo_tag'}]
     result = nsp._process_base_create_lswitch_args(self.cluster,
                                                    self.tenant_id,
                                                    self.display_name,
                                                    self.tz_config,
                                                    tags=more_tags)
     expected = self.tags + more_tags
     self.assertEqual(expected, result[2])
示例#11
0
 def test_create_lswitch_with_additional_tags(self):
     more_tags = [{'scope': 'foo_scope', 'tag': 'foo_tag'}]
     result = nsp._process_base_create_lswitch_args(self.cluster,
                                                    'foo_id',
                                                    self.tenant_id,
                                                    self.display_name,
                                                    self.tz_config,
                                                    tags=more_tags)
     expected = self.tags + more_tags
     self.assertEqual(sorted(expected), sorted(result[2]))
示例#12
0
 def test_create_lswitch_with_shared_as_arg(self):
     result = nsp._process_base_create_lswitch_args(self.cluster,
                                                    'foo_id',
                                                    self.tenant_id,
                                                    self.display_name,
                                                    self.tz_config,
                                                    True)
     additional_tags = [{'scope': 'shared', 'tag': 'true'}]
     expected = self.tags + additional_tags
     self.assertEqual(sorted(expected), sorted(result[2]))
示例#13
0
 def test_create_lswitch_with_neutron_net_id_as_arg(self):
     result = nsp._process_base_create_lswitch_args(
         self.cluster, self.tenant_id, self.display_name, self.tz_config, "foo"
     )
     expected = self.tags + [{"scope": "quantum_net_id", "tag": "foo"}]
     self.assertEqual(expected, result[2])