Skip to content

Commit

Permalink
Merge "Get ifmap_uuid_mapper_test to work"
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuul authored and opencontrail-ci-admin committed Feb 16, 2017
2 parents d891749 + 32b457c commit b9a97cd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 18 deletions.
12 changes: 0 additions & 12 deletions src/ifmap/test/ifmap_uuid_mapper_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -216,12 +216,10 @@ TEST_P(IFMapVmUuidMapperTestWithParam1, ConfigThenSubscribe) {
EXPECT_EQ(0, vm_uuid_mapper_->PendingVmRegCount());
TASK_UTIL_EXPECT_EQ(3, c1.NodeKeyCount("virtual-machine"));

#ifdef IFMAP_UT_TODO
TASK_UTIL_EXPECT_EQ(3, c1.NodeKeyCount("virtual-machine-interface"));
TASK_UTIL_EXPECT_EQ(1, c1.NodeKeyCount("virtual-network"));
TASK_UTIL_EXPECT_TRUE(c1.NodeExists("virtual-network",
"default-domain:demo:vn27"));
#endif
}

// Add all the config and then simulate receiving a vm-subscribe just after the
Expand Down Expand Up @@ -549,12 +547,10 @@ TEST_P(IFMapVmUuidMapperTestWithParam1, CfgSubUnsub) {
TASK_UTIL_EXPECT_TRUE(c1.NodeExists("virtual-router",
"default-global-system-config:a1s27.contrail.juniper.net"));
TASK_UTIL_EXPECT_EQ(3, c1.NodeKeyCount("virtual-machine"));
#ifdef IFMAP_UT_TODO
TASK_UTIL_EXPECT_TRUE(c1.NodeExists("virtual-network",
"default-domain:demo:vn27"));
TASK_UTIL_EXPECT_EQ(1, c1.NodeKeyCount("virtual-network"));
TASK_UTIL_EXPECT_EQ(3, c1.NodeKeyCount("virtual-machine-interface"));
#endif
EXPECT_EQ(3, vm_uuid_mapper_->UuidMapperCount());
EXPECT_EQ(3, vm_uuid_mapper_->NodeUuidMapCount());
EXPECT_EQ(0, vm_uuid_mapper_->PendingVmRegCount());
Expand All @@ -565,19 +561,15 @@ TEST_P(IFMapVmUuidMapperTestWithParam1, CfgSubUnsub) {
"2d308482-c7b3-4e05-af14-e732b7b50117", false, 1);
TASK_UTIL_EXPECT_EQ(2, c1.NodeKeyCount("virtual-machine"));

#ifdef IFMAP_UT_TODO
TASK_UTIL_EXPECT_EQ(1, c1.NodeKeyCount("virtual-network"));
TASK_UTIL_EXPECT_EQ(2, c1.NodeKeyCount("virtual-machine-interface"));
#endif

server_->ProcessVmSubscribe(
"default-global-system-config:a1s27.contrail.juniper.net",
"93e76278-1990-4905-a472-8e9188f41b2c", false, 2);
TASK_UTIL_EXPECT_EQ(1, c1.NodeKeyCount("virtual-machine"));
#ifdef IFMAP_UT_TODO
TASK_UTIL_EXPECT_EQ(1, c1.NodeKeyCount("virtual-network"));
TASK_UTIL_EXPECT_EQ(1, c1.NodeKeyCount("virtual-machine-interface"));
#endif
server_->ProcessVmSubscribe(
"default-global-system-config:a1s27.contrail.juniper.net",
"43d086ab-52c4-4a1f-8c3d-63b321e36e8a", false, 3);
Expand Down Expand Up @@ -644,20 +636,16 @@ TEST_P(IFMapVmUuidMapperTestWithParam1, SubscribeConfigUnsub) {
"2d308482-c7b3-4e05-af14-e732b7b50117", false, 1);
TASK_UTIL_EXPECT_EQ(2, c1.NodeKeyCount("virtual-machine"));

#ifdef IFMAP_UT_TODO
TASK_UTIL_EXPECT_EQ(1, c1.NodeKeyCount("virtual-network"));
TASK_UTIL_EXPECT_EQ(2, c1.NodeKeyCount("virtual-machine-interface"));
#endif

server_->ProcessVmSubscribe(
"default-global-system-config:a1s27.contrail.juniper.net",
"93e76278-1990-4905-a472-8e9188f41b2c", false, 2);
TASK_UTIL_EXPECT_EQ(1, c1.NodeKeyCount("virtual-machine"));

#ifdef IFMAP_UT_TODO
TASK_UTIL_EXPECT_EQ(1, c1.NodeKeyCount("virtual-network"));
TASK_UTIL_EXPECT_EQ(1, c1.NodeKeyCount("virtual-machine-interface"));
#endif

server_->ProcessVmSubscribe(
"default-global-system-config:a1s27.contrail.juniper.net",
Expand Down
6 changes: 3 additions & 3 deletions src/ifmap/testdata/cli1_vn1_vm3_add.json
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@
"2d308482-c7b3-4e05-af14-e732b7b50117": {
"fq_name": "[\"2d308482-c7b3-4e05-af14-e732b7b50117\"]",
"type": "\"virtual_machine\"",
"ref:virtual_machine_interface:ef1e9828-05b6-44a2-a410-d1b662594fc3": "{\"attr\":{}}",
"prop:id_perms": "{\"permissions\":{\"owner\":\"cloud-admin\",\"owner_access\":\"7\",\"group\":\"cloud-admin-group\",\"group_access\":\"7\",\"other_access\":\"7\"},\"uuid\":{\"uuid_mslong\":\"3256248227819900421\",\"uuid_lslong\":\"12615962661188075799\"},\"enable\":\"true\",\"created\":null,\"last_modified\":null}"
},
"2f560900-2a1a-44c1-b248-6c87201fc8c6": {
Expand All @@ -192,7 +191,6 @@
"93e76278-1990-4905-a472-8e9188f41b2c": {
"fq_name": "[\"93e76278-1990-4905-a472-8e9188f41b2c\"]",
"type": "\"virtual_machine\"",
"ref:virtual_machine_interface:c4287577-b6af-4cca-a21d-6470a08af68a": "{\"attr\":{}}",
"prop:id_perms": "{\"permissions\":{\"owner\":\"cloud-admin\",\"owner_access\":\"7\",\"group\":\"cloud-admin-group\",\"group_access\":\"7\",\"other_access\":\"7\"},\"uuid\":{\"uuid_mslong\":\"10657595311160051973\",\"uuid_lslong\":\"11849690325284297516\"},\"enable\":\"true\",\"created\":null,\"last_modified\":null}"
},
"68e1ae0a-2b13-4ad0-8e19-9a1de06e15b6": {
Expand Down Expand Up @@ -248,7 +246,6 @@
"43d086ab-52c4-4a1f-8c3d-63b321e36e8a": {
"fq_name": "[\"43d086ab-52c4-4a1f-8c3d-63b321e36e8a\"]",
"type": "\"virtual_machine\"",
"ref:virtual_machine_interface:100698e8-dc7a-4bf3-bebe-3fff718bf3c9": "{\"attr\":{}}",
"prop:id_perms": "{\"permissions\":{\"owner\":\"cloud-admin\",\"owner_access\":\"7\",\"group\":\"cloud-admin-group\",\"group_access\":\"7\",\"other_access\":\"7\"},\"uuid\":{\"uuid_mslong\":\"4886553666083113503\",\"uuid_lslong\":\"10105342759908109962\"},\"enable\":\"true\",\"created\":null,\"last_modified\":null}"
},
"5e6cd1e6-0e29-477e-a40e-b4737e2337fd": {
Expand Down Expand Up @@ -348,13 +345,15 @@
"c4287577-b6af-4cca-a21d-6470a08af68a": {
"fq_name": "[\"93e76278-1990-4905-a472-8e9188f41b2c\",\"c4287577-b6af-4cca-a21d-6470a08af68a\"]",
"type": "\"virtual_machine_interface\"",
"ref:virtual_machine:93e76278-1990-4905-a472-8e9188f41b2c": "{\"attr\":{}}",
"ref:virtual_network:31b50cbb-679b-4f82-b268-8ee7c6adf833": "{\"attr\":{}}",
"prop:virtual_machine_interface_mac_addresses": "{\"xmlns:contrail\":\"http://www.contrailsystems.com/vnc_cfg.xsd\",\"ifmap_cardinality\":\"singleValue\",\"ifmap_publisher_id\":\"api-server-1--0000000001-1\",\"ifmap_timestamp\":\"2013-03-11T03:01:06-07:00\",\"mac_address\":[\"02:c4:28:75:77:b6\"]}",
"prop:id_perms": "{\"permissions\":{\"owner\":\"cloud-admin\",\"owner_access\":\"7\",\"group\":\"cloud-admin-group\",\"group_access\":\"7\",\"other_access\":\"7\"},\"uuid\":{\"uuid_mslong\":\"14134676587528801482\",\"uuid_lslong\":\"11681603443361511050\"},\"enable\":\"true\",\"created\":null,\"last_modified\":null}"
},
"ef1e9828-05b6-44a2-a410-d1b662594fc3": {
"fq_name": "[\"2d308482-c7b3-4e05-af14-e732b7b50117\",\"ef1e9828-05b6-44a2-a410-d1b662594fc3\"]",
"type": "\"virtual_machine_interface\"",
"ref:virtual_machine:2d308482-c7b3-4e05-af14-e732b7b50117": "{\"attr\":{}}",
"ref:virtual_network:31b50cbb-679b-4f82-b268-8ee7c6adf833": "{\"attr\":{}}",
"prop:virtual_machine_interface_mac_addresses": "{\"xmlns:contrail\":\"http://www.contrailsystems.com/vnc_cfg.xsd\",\"ifmap_cardinality\":\"singleValue\",\"ifmap_publisher_id\":\"api-server-1--0000000001-1\",\"ifmap_timestamp\":\"2013-03-11T03:00:25-07:00\",\"mac_address\":[\"02:ef:1e:98:28:05\"]}",
"prop:id_perms": "{\"permissions\":{\"owner\":\"cloud-admin\",\"owner_access\":\"7\",\"group\":\"cloud-admin-group\",\"group_access\":\"7\",\"other_access\":\"7\"},\"uuid\":{\"uuid_mslong\":\"17230376522028041378\",\"uuid_lslong\":\"11822179603111825347\"},\"enable\":\"true\",\"created\":null,\"last_modified\":null}"
Expand Down Expand Up @@ -409,6 +408,7 @@
"100698e8-dc7a-4bf3-bebe-3fff718bf3c9": {
"fq_name": "[\"43d086ab-52c4-4a1f-8c3d-63b321e36e8a\",\"100698e8-dc7a-4bf3-bebe-3fff718bf3c9\"]",
"type": "\"virtual_machine_interface\"",
"ref:virtual_machine:43d086ab-52c4-4a1f-8c3d-63b321e36e8a": "{\"attr\":{}}",
"ref:virtual_network:31b50cbb-679b-4f82-b268-8ee7c6adf833": "{\"attr\":{}}",
"prop:virtual_machine_interface_mac_addresses": "{\"xmlns:contrail\":\"http://www.contrailsystems.com/vnc_cfg.xsd\",\"ifmap_cardinality\":\"singleValue\",\"ifmap_publisher_id\":\"api-server-1--0000000001-1\",\"ifmap_timestamp\":\"2013-03-11T02:55:41-07:00\",\"mac_address\":[\"02:10:06:98:e8:dc\"]}",
"prop:id_perms": "{\"permissions\":{\"owner\":\"cloud-admin\",\"owner_access\":\"7\",\"group\":\"cloud-admin-group\",\"group_access\":\"7\",\"other_access\":\"7\"},\"uuid\":{\"uuid_mslong\":\"1154778480365947891\",\"uuid_lslong\":\"13744493479135540169\"},\"enable\":\"true\",\"created\":null,\"last_modified\":null}"
Expand Down
6 changes: 3 additions & 3 deletions src/ifmap/testdata/cli1_vn1_vm3_add_vmname.json
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@
"2d308482-c7b3-4e05-af14-e732b7b50117": {
"fq_name": "[\"vm_with_a_name1\"]",
"type": "\"virtual_machine\"",
"ref:virtual_machine_interface:ef1e9828-05b6-44a2-a410-d1b662594fc3": "{\"attr\":{}}",
"prop:id_perms": "{\"permissions\":{\"owner\":\"cloud-admin\",\"owner_access\":\"7\",\"group\":\"cloud-admin-group\",\"group_access\":\"7\",\"other_access\":\"7\"},\"uuid\":{\"uuid_mslong\":\"3256248227819900421\",\"uuid_lslong\":\"12615962661188075799\"},\"enable\":\"true\",\"created\":null,\"last_modified\":null}"
},
"2f560900-2a1a-44c1-b248-6c87201fc8c6": {
Expand All @@ -192,7 +191,6 @@
"93e76278-1990-4905-a472-8e9188f41b2c": {
"fq_name": "[\"vm_with_a_name3\"]",
"type": "\"virtual_machine\"",
"ref:virtual_machine_interface:c4287577-b6af-4cca-a21d-6470a08af68a": "{\"attr\":{}}",
"prop:id_perms": "{\"permissions\":{\"owner\":\"cloud-admin\",\"owner_access\":\"7\",\"group\":\"cloud-admin-group\",\"group_access\":\"7\",\"other_access\":\"7\"},\"uuid\":{\"uuid_mslong\":\"10657595311160051973\",\"uuid_lslong\":\"11849690325284297516\"},\"enable\":\"true\",\"created\":null,\"last_modified\":null}"
},
"68e1ae0a-2b13-4ad0-8e19-9a1de06e15b6": {
Expand Down Expand Up @@ -248,7 +246,6 @@
"43d086ab-52c4-4a1f-8c3d-63b321e36e8a": {
"fq_name": "[\"vm_with_a_name2\"]",
"type": "\"virtual_machine\"",
"ref:virtual_machine_interface:100698e8-dc7a-4bf3-bebe-3fff718bf3c9": "{\"attr\":{}}",
"prop:id_perms": "{\"permissions\":{\"owner\":\"cloud-admin\",\"owner_access\":\"7\",\"group\":\"cloud-admin-group\",\"group_access\":\"7\",\"other_access\":\"7\"},\"uuid\":{\"uuid_mslong\":\"4886553666083113503\",\"uuid_lslong\":\"10105342759908109962\"},\"enable\":\"true\",\"created\":null,\"last_modified\":null}"
},
"5e6cd1e6-0e29-477e-a40e-b4737e2337fd": {
Expand Down Expand Up @@ -348,13 +345,15 @@
"c4287577-b6af-4cca-a21d-6470a08af68a": {
"fq_name": "[\"vm_with_a_name3\",\"c4287577-b6af-4cca-a21d-6470a08af68a\"]",
"type": "\"virtual_machine_interface\"",
"ref:virtual_machine:93e76278-1990-4905-a472-8e9188f41b2c": "{\"attr\":{}}",
"ref:virtual_network:31b50cbb-679b-4f82-b268-8ee7c6adf833": "{\"attr\":{}}",
"prop:virtual_machine_interface_mac_addresses": "{\"xmlns:contrail\":\"http://www.contrailsystems.com/vnc_cfg.xsd\",\"ifmap_cardinality\":\"singleValue\",\"ifmap_publisher_id\":\"api-server-1--0000000001-1\",\"ifmap_timestamp\":\"2013-03-11T03:01:06-07:00\",\"mac_address\":[\"02:c4:28:75:77:b6\"]}",
"prop:id_perms": "{\"permissions\":{\"owner\":\"cloud-admin\",\"owner_access\":\"7\",\"group\":\"cloud-admin-group\",\"group_access\":\"7\",\"other_access\":\"7\"},\"uuid\":{\"uuid_mslong\":\"14134676587528801482\",\"uuid_lslong\":\"11681603443361511050\"},\"enable\":\"true\",\"created\":null,\"last_modified\":null}"
},
"ef1e9828-05b6-44a2-a410-d1b662594fc3": {
"fq_name": "[\"vm_with_a_name1\",\"ef1e9828-05b6-44a2-a410-d1b662594fc3\"]",
"type": "\"virtual_machine_interface\"",
"ref:virtual_machine:2d308482-c7b3-4e05-af14-e732b7b50117": "{\"attr\":{}}",
"ref:virtual_network:31b50cbb-679b-4f82-b268-8ee7c6adf833": "{\"attr\":{}}",
"prop:virtual_machine_interface_mac_addresses": "{\"xmlns:contrail\":\"http://www.contrailsystems.com/vnc_cfg.xsd\",\"ifmap_cardinality\":\"singleValue\",\"ifmap_publisher_id\":\"api-server-1--0000000001-1\",\"ifmap_timestamp\":\"2013-03-11T03:00:25-07:00\",\"mac_address\":[\"02:ef:1e:98:28:05\"]}",
"prop:id_perms": "{\"permissions\":{\"owner\":\"cloud-admin\",\"owner_access\":\"7\",\"group\":\"cloud-admin-group\",\"group_access\":\"7\",\"other_access\":\"7\"},\"uuid\":{\"uuid_mslong\":\"17230376522028041378\",\"uuid_lslong\":\"11822179603111825347\"},\"enable\":\"true\",\"created\":null,\"last_modified\":null}"
Expand Down Expand Up @@ -409,6 +408,7 @@
"100698e8-dc7a-4bf3-bebe-3fff718bf3c9": {
"fq_name": "[\"vm_with_a_name2\",\"100698e8-dc7a-4bf3-bebe-3fff718bf3c9\"]",
"type": "\"virtual_machine_interface\"",
"ref:virtual_machine:43d086ab-52c4-4a1f-8c3d-63b321e36e8a": "{\"attr\":{}}",
"ref:virtual_network:31b50cbb-679b-4f82-b268-8ee7c6adf833": "{\"attr\":{}}",
"prop:virtual_machine_interface_mac_addresses": "{\"xmlns:contrail\":\"http://www.contrailsystems.com/vnc_cfg.xsd\",\"ifmap_cardinality\":\"singleValue\",\"ifmap_publisher_id\":\"api-server-1--0000000001-1\",\"ifmap_timestamp\":\"2013-03-11T02:55:41-07:00\",\"mac_address\":[\"02:10:06:98:e8:dc\"]}",
"prop:id_perms": "{\"permissions\":{\"owner\":\"cloud-admin\",\"owner_access\":\"7\",\"group\":\"cloud-admin-group\",\"group_access\":\"7\",\"other_access\":\"7\"},\"uuid\":{\"uuid_mslong\":\"1154778480365947891\",\"uuid_lslong\":\"13744493479135540169\"},\"enable\":\"true\",\"created\":null,\"last_modified\":null}"
Expand Down

0 comments on commit b9a97cd

Please sign in to comment.