Skip to content

Commit

Permalink
100% unit test coverage for create.py
Browse files Browse the repository at this point in the history
  • Loading branch information
allenrobel committed Feb 13, 2024
1 parent 8c61cac commit ad992ed
Show file tree
Hide file tree
Showing 9 changed files with 622 additions and 67 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,67 @@
"i.e. the controller response consisting of all image policies that",
"exist on the controller, keyed on policy_name."
],
"test_image_policy_create_00030a": {
"KR5M": {
"agnostic": false,
"epldImgName": "n9000-epld.10.2.5.M.img",
"imageName": "nxos64-cs.10.2.5.M.bin",
"nxosVersion": "10.2.5_nxos64-cs_64bit",
"packageName": "mtx-openconfig-all-2.0.0.0-10.4.1.src.rpm",
"platform": "N9K/N3K",
"platformPolicies": "",
"policyDescr": "KR5M",
"policyName": "KR5M",
"policyType": "PLATFORM",
"ref_count": 0,
"rpmimages": "mtx-grpctunnel-2.1.0.0-10.4.1.lib32_64_n9000"
},
"NR3F": {
"agnostic": false,
"epldImgName": "n9000-epld.10.3.1.F.img",
"imageName": "nxos64-cs.10.3.1.F.bin",
"nxosVersion": "10.3.1_nxos64-cs_64bit",
"packageName": "",
"platform": "N9K/N3K",
"platformPolicies": "",
"policyDescr": "NR3F",
"policyName": "NR3F",
"policyType": "PLATFORM",
"ref_count": 0,
"rpmimages": null
}
},
"test_image_policy_create_00031a": {
"KR5M": {
"agnostic": false,
"epldImgName": "n9000-epld.10.2.5.M.img",
"imageName": "nxos64-cs.10.2.5.M.bin",
"nxosVersion": "10.2.5_nxos64-cs_64bit",
"packageName": "mtx-openconfig-all-2.0.0.0-10.4.1.src.rpm",
"platform": "N9K/N3K",
"platformPolicies": "",
"policyDescr": "KR5M",
"policyName": "KR5M",
"policyType": "PLATFORM",
"ref_count": 0,
"rpmimages": "mtx-grpctunnel-2.1.0.0-10.4.1.lib32_64_n9000"
},
"NR3F": {
"agnostic": false,
"epldImgName": "n9000-epld.10.3.1.F.img",
"imageName": "nxos64-cs.10.3.1.F.bin",
"nxosVersion": "10.3.1_nxos64-cs_64bit",
"packageName": "",
"platform": "N9K/N3K",
"platformPolicies": "",
"policyDescr": "NR3F",
"policyName": "NR3F",
"policyType": "PLATFORM",
"ref_count": 0,
"rpmimages": null
}
},
"test_image_policy_create_00035a": {},
"test_image_policy_create_bulk_00030a": {
"KR5M": {
"agnostic": false,
Expand Down Expand Up @@ -110,5 +171,7 @@
"rpmimages": "mtx-grpctunnel-2.1.0.0-10.4.1.lib32_64_n9000"
}
},
"test_image_policy_create_bulk_00035a": {}
"test_image_policy_create_bulk_00035a": {},
"test_image_policy_create_bulk_00036a": {},
"test_image_policy_create_bulk_00037a": {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,38 @@
"policyDescr": "image policy of 10.3(3)F",
"policyName": "FOO",
"rpmimages": "mtx-grpctunnel-2.1.0.0-10.4.1.lib32_64_n9000"
},
"test_image_policy_create_00030a": {
"agnostic": false,
"epldImgName": "n9000-epld.10.3.2.F.img",
"nxosVersion": "10.3.1_nxos64-cs_64bit",
"packageName": "mtx-openconfig-all-2.0.0.0-10.4.1.src.rpm",
"platform": "N9K",
"policyDescr": "image policy of 10.3(3)F",
"policyName": "KR5M",
"policyType": "PLATFORM",
"rpmimages": "mtx-grpctunnel-2.1.0.0-10.4.1.lib32_64_n9000"
},
"test_image_policy_create_00031a": {
"agnostic": false,
"epldImgName": "n9000-epld.10.3.2.F.img",
"nxosVersion": "10.3.1_nxos64-cs_64bit",
"packageName": "mtx-openconfig-all-2.0.0.0-10.4.1.src.rpm",
"platform": "N9K",
"policyDescr": "image policy of 10.3(3)F",
"policyName": "FOO",
"policyType": "PLATFORM",
"rpmimages": "mtx-grpctunnel-2.1.0.0-10.4.1.lib32_64_n9000"
},
"test_image_policy_create_00035a": {
"agnostic": false,
"epldImgName": "n9000-epld.10.3.2.F.img",
"nxosVersion": "10.3.1_nxos64-cs_64bit",
"packageName": "mtx-openconfig-all-2.0.0.0-10.4.1.src.rpm",
"platform": "N9K",
"policyDescr": "image policy of 10.3(3)F",
"policyName": "FOO",
"policyType": "PLATFORM",
"rpmimages": "mtx-grpctunnel-2.1.0.0-10.4.1.lib32_64_n9000"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -135,5 +135,68 @@
"policyType": "PLATFORM",
"rpmimages": "mtx-grpctunnel-2.1.0.0-10.4.1.lib32_64_n9000"
}
],
"test_image_policy_create_bulk_00036a": [
{
"agnostic": false,
"epldImgName": "n9000-epld.10.3.2.F.img",
"nxosVersion": "10.3.1_nxos64-cs_64bit",
"packageName": "mtx-openconfig-all-2.0.0.0-10.4.1.src.rpm",
"platform": "N9K",
"policyDescr": "image policy of 10.3(3)F",
"policyName": "FOO",
"policyType": "PLATFORM",
"rpmimages": "mtx-grpctunnel-2.1.0.0-10.4.1.lib32_64_n9000"
}
],
"test_image_policy_create_bulk_00037a": [
{
"agnostic": false,
"epldImgName": "n9000-epld.10.3.2.F.img",
"nxosVersion": "10.3.1_nxos64-cs_64bit",
"packageName": "mtx-openconfig-all-2.0.0.0-10.4.1.src.rpm",
"platform": "N9K",
"policyDescr": "image policy of 10.3(3)F",
"policyName": "FOO",
"policyType": "PLATFORM",
"rpmimages": "mtx-grpctunnel-2.1.0.0-10.4.1.lib32_64_n9000"
}
],
"test_image_policy_create_bulk_00037b": [
{
"agnostic": false,
"epldImgName": "n9000-epld.10.3.2.F.img",
"nxosVersion": "10.3.1_nxos64-cs_64bit",
"packageName": "",
"platform": "N9K",
"policyDescr": "image policy of 10.3(3)F",
"policyName": "BAR",
"policyType": "PLATFORM",
"rpmimages": ""
}
],
"test_image_policy_create_bulk_00037c": [
{
"agnostic": false,
"epldImgName": "n9000-epld.10.3.2.F.img",
"nxosVersion": "10.3.1_nxos64-cs_64bit",
"packageName": "mtx-openconfig-all-2.0.0.0-10.4.1.src.rpm",
"platform": "N9K",
"policyDescr": "image policy of 10.3(3)F",
"policyName": "FOO",
"policyType": "PLATFORM",
"rpmimages": "mtx-grpctunnel-2.1.0.0-10.4.1.lib32_64_n9000"
},
{
"agnostic": false,
"epldImgName": "n9000-epld.10.3.2.F.img",
"nxosVersion": "10.3.1_nxos64-cs_64bit",
"packageName": "",
"platform": "N9K",
"policyDescr": "image policy of 10.3(3)F",
"policyName": "BAR",
"policyType": "PLATFORM",
"rpmimages": ""
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"test_image_policy_create_00035a": {
"DATA": "Policy created successfully.",
"MESSAGE": "OK",
"METHOD": "POST",
"REQUEST_PATH": "https://172.22.150.244:443/appcenter/cisco/ndfc/api/v1/imagemanagement/rest/policymgnt/platform-policy",
"RETURN_CODE": 200
},
"test_image_policy_create_00036a": {
"DATA": "Internal server error.",
"MESSAGE": "NOK",
"METHOD": "POST",
"REQUEST_PATH": "https://172.22.150.244:443/appcenter/cisco/ndfc/api/v1/imagemanagement/rest/policymgnt/platform-policy",
"RETURN_CODE": 500
},
"test_image_policy_create_00037a": [
{
"DATA": "Policy created successfully.",
"MESSAGE": "OK",
"METHOD": "POST",
"REQUEST_PATH": "https://172.22.150.244:443/appcenter/cisco/ndfc/api/v1/imagemanagement/rest/policymgnt/platform-policy",
"RETURN_CODE": 200
}
],
"test_image_policy_create_00037b": [
{
"DATA": "Internal server error.",
"MESSAGE": "NOK",
"METHOD": "POST",
"REQUEST_PATH": "https://172.22.150.244:443/appcenter/cisco/ndfc/api/v1/imagemanagement/rest/policymgnt/platform-policy",
"RETURN_CODE": 500
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,30 @@
"METHOD": "POST",
"REQUEST_PATH": "https://172.22.150.244:443/appcenter/cisco/ndfc/api/v1/imagemanagement/rest/policymgnt/platform-policy",
"RETURN_CODE": 200
}
},
"test_image_policy_create_bulk_00036a": {
"DATA": "Internal server error.",
"MESSAGE": "NOK",
"METHOD": "POST",
"REQUEST_PATH": "https://172.22.150.244:443/appcenter/cisco/ndfc/api/v1/imagemanagement/rest/policymgnt/platform-policy",
"RETURN_CODE": 500
},
"test_image_policy_create_bulk_00037a": [
{
"DATA": "Policy created successfully.",
"MESSAGE": "OK",
"METHOD": "POST",
"REQUEST_PATH": "https://172.22.150.244:443/appcenter/cisco/ndfc/api/v1/imagemanagement/rest/policymgnt/platform-policy",
"RETURN_CODE": 200
}
],
"test_image_policy_create_bulk_00037b": [
{
"DATA": "Internal server error.",
"MESSAGE": "NOK",
"METHOD": "POST",
"REQUEST_PATH": "https://172.22.150.244:443/appcenter/cisco/ndfc/api/v1/imagemanagement/rest/policymgnt/platform-policy",
"RETURN_CODE": 500
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"test_image_policy_create_bulk_00037a": [
{
"changed": true,
"success": true
}
],
"test_image_policy_create_bulk_00037b": [
{
"changed": false,
"success": false
}
]
}
Loading

0 comments on commit ad992ed

Please sign in to comment.