Skip to content

Commit 68b6c29

Browse files
author
abdulla-ashurov
committed
Add REST API and gRPC integration tests for checking new implementations
1 parent e4c260e commit 68b6c29

File tree

3 files changed

+68
-55
lines changed

3 files changed

+68
-55
lines changed

integration_tests/cli/compliance-demo.sh

+3-1
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ test_divider
542542

543543
# ADD CERTIFY MODEL WITH ALL OPTIONAL FIELDS
544544
echo "Certify Model with VID: $vid PID: $pid SV: ${sv} with zigbee certification"
545-
result=$(echo "$passphrase" | dcld tx compliance certify-model --vid=$vid --pid=$pid --softwareVersion=$sv --softwareVersionString=$svs --certificationType="$zigbee_certification_type" --certificationDate="$certification_date" --cdCertificateId="$cd_certificate_id" --programTypeVersion="1.0" --familyId="someFID" --supportedClusters="someClusters" --compliantPlatformUsed="WIFI" --compliantPlatformVersion="V1" --OSVersion="someV" --certificationRoute="Full" --programType="pType" --transport="someTransport" --parentChild="parent" --from $zb_account --yes)
545+
result=$(echo "$passphrase" | dcld tx compliance certify-model --vid=$vid --pid=$pid --softwareVersion=$sv --softwareVersionString=$svs --certificationType="$zigbee_certification_type" --certificationDate="$certification_date" --cdCertificateId="$cd_certificate_id" --programTypeVersion="1.0" --familyId="someFID" --supportedClusters="someClusters" --compliantPlatformUsed="WIFI" --compliantPlatformVersion="V1" --OSVersion="someV" --certificationRoute="Full" --programType="pType" --transport="someTransport" --parentChild="parent" --certificationIDOfSoftwareComponent="someIDOfSoftwareComponent" --from $zb_account --yes)
546546
echo "$result"
547547
check_response "$result" "\"code\": 0"
548548

@@ -577,6 +577,7 @@ check_response "$result" "\"certificationRoute\": \"Full\""
577577
check_response "$result" "\"programType\": \"pType\""
578578
check_response "$result" "\"transport\": \"someTransport\""
579579
check_response "$result" "\"parentChild\": \"parent\""
580+
check_response "$result" "\"certificationIdOfSoftwareComponent\": \"someIDOfSoftwareComponent\""
580581
echo "$result"
581582

582583
test_divider
@@ -600,6 +601,7 @@ check_response "$result" "\"certificationRoute\": \"Full\""
600601
check_response "$result" "\"programType\": \"pType\""
601602
check_response "$result" "\"transport\": \"someTransport\""
602603
check_response "$result" "\"parentChild\": \"parent\""
604+
check_response "$result" "\"certificationIdOfSoftwareComponent\": \"someIDOfSoftwareComponent\""
603605
echo "$result"
604606
###########################################################################################################################################
605607

integration_tests/cli/compliance-provisioning.sh

+5-2
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ test_divider
458458

459459
# ADD PROVISION MODEL WITH ALL OPTIONAL FIELDS
460460
echo "Provision Model with VID: $vid PID: $pid SV: ${sv} with zigbee certification"
461-
result=$(echo "$passphrase" | dcld tx compliance provision-model --vid=$vid --pid=$pid --softwareVersion=$sv --softwareVersionString=$svs --certificationType="$certification_type_zb" --provisionalDate="$provision_date" --reason "$provision_reason" --cdCertificateId="$cd_certificate_id" --programTypeVersion="1.0" --familyId="someFID" --supportedClusters="someClusters" --compliantPlatformUsed="WIFI" --compliantPlatformVersion="V1" --OSVersion="someV" --certificationRoute="Full" --programType="pType" --transport="someTransport" --parentChild="parent" --from $zb_account --yes)
461+
result=$(echo "$passphrase" | dcld tx compliance provision-model --vid=$vid --pid=$pid --softwareVersion=$sv --softwareVersionString=$svs --certificationType="$certification_type_zb" --provisionalDate="$provision_date" --reason "$provision_reason" --cdCertificateId="$cd_certificate_id" --programTypeVersion="1.0" --familyId="someFID" --supportedClusters="someClusters" --compliantPlatformUsed="WIFI" --compliantPlatformVersion="V1" --OSVersion="someV" --certificationRoute="Full" --programType="pType" --transport="someTransport" --parentChild="parent" --certificationIDOfSoftwareComponent="someIDOfSoftwareComponent1" --from $zb_account --yes)
462462
echo "$result"
463463
check_response "$result" "\"code\": 0"
464464

@@ -490,6 +490,7 @@ check_response "$result" "\"certificationRoute\": \"Full\""
490490
check_response "$result" "\"programType\": \"pType\""
491491
check_response "$result" "\"transport\": \"someTransport\""
492492
check_response "$result" "\"parentChild\": \"parent\""
493+
check_response "$result" "\"certificationIdOfSoftwareComponent\": \"someIDOfSoftwareComponent1\""
493494
echo "$result"
494495
###########################################################################################################################################
495496

@@ -510,7 +511,7 @@ check_response "$result" "\"code\": 0"
510511

511512
# ADD CERTIFY MODEL WITH SOME OPTIONAL FIELDS
512513
echo "Certify Model with VID: $vid PID: $pid SV: ${sv} with zigbee certification"
513-
result=$(echo "$passphrase" | dcld tx compliance certify-model --vid=$vid --pid=$pid --softwareVersion=$sv --softwareVersionString=$svs --certificationType="$certification_type_zb" --certificationDate="$certification_date" --cdCertificateId="$cd_certificate_id" --programTypeVersion="2.0" --familyId="someFID2" --supportedClusters="someClusters2" --compliantPlatformUsed="ETHERNET" --compliantPlatformVersion="V2" --from $zb_account --yes)
514+
result=$(echo "$passphrase" | dcld tx compliance certify-model --vid=$vid --pid=$pid --softwareVersion=$sv --softwareVersionString=$svs --certificationType="$certification_type_zb" --certificationDate="$certification_date" --cdCertificateId="$cd_certificate_id" --programTypeVersion="2.0" --familyId="someFID2" --supportedClusters="someClusters2" --compliantPlatformUsed="ETHERNET" --compliantPlatformVersion="V2" --certificationIDOfSoftwareComponent="someIDOfSoftwareComponent2" --from $zb_account --yes)
514515
echo "$result"
515516
check_response "$result" "\"code\": 0"
516517

@@ -541,6 +542,7 @@ check_response "$result" "\"certificationRoute\": \"Full\""
541542
check_response "$result" "\"programType\": \"pType\""
542543
check_response "$result" "\"transport\": \"someTransport\""
543544
check_response "$result" "\"parentChild\": \"parent\""
545+
check_response "$result" "\"certificationIdOfSoftwareComponent\": \"someIDOfSoftwareComponent2\""
544546
echo "$result"
545547

546548
# GET DEVICE SOFTWARE COMPLIANCE
@@ -563,6 +565,7 @@ check_response "$result" "\"certificationRoute\": \"Full\""
563565
check_response "$result" "\"programType\": \"pType\""
564566
check_response "$result" "\"transport\": \"someTransport\""
565567
check_response "$result" "\"parentChild\": \"parent\""
568+
check_response "$result" "\"certificationIdOfSoftwareComponent\": \"someIDOfSoftwareComponent2\""
566569
echo "$result"
567570
###########################################################################################################################################
568571

integration_tests/grpc_rest/compliance/helpers.go

+60-52
Original file line numberDiff line numberDiff line change
@@ -717,25 +717,26 @@ func DemoTrackCompliance(suite *utils.TestSuite) {
717717
// Certify model with all optional fields
718718
certReason = "some reason 3"
719719
certifyModelMsg = compliancetypes.MsgCertifyModel{
720-
Vid: vid,
721-
Pid: pid,
722-
SoftwareVersion: sv,
723-
SoftwareVersionString: svs,
724-
CertificationDate: certDate,
725-
CertificationType: "zigbee",
726-
Reason: certReason,
727-
CDCertificateId: testconstants.CDCertificateID,
728-
ProgramTypeVersion: testconstants.ProgramTypeVersion,
729-
FamilyId: testconstants.FamilyID,
730-
SupportedClusters: testconstants.SupportedClusters,
731-
CompliantPlatformUsed: testconstants.CompliantPlatformUsed,
732-
CompliantPlatformVersion: testconstants.CompliantPlatformVersion,
733-
OSVersion: testconstants.OSVersion,
734-
CertificationRoute: testconstants.CertificationRoute,
735-
ProgramType: testconstants.ProgramType,
736-
Transport: testconstants.Transport,
737-
ParentChild: testconstants.ParentChild1,
738-
Signer: certCenterAccount.Address,
720+
Vid: vid,
721+
Pid: pid,
722+
SoftwareVersion: sv,
723+
SoftwareVersionString: svs,
724+
CertificationDate: certDate,
725+
CertificationType: "zigbee",
726+
Reason: certReason,
727+
CDCertificateId: testconstants.CDCertificateID,
728+
ProgramTypeVersion: testconstants.ProgramTypeVersion,
729+
FamilyId: testconstants.FamilyID,
730+
SupportedClusters: testconstants.SupportedClusters,
731+
CompliantPlatformUsed: testconstants.CompliantPlatformUsed,
732+
CompliantPlatformVersion: testconstants.CompliantPlatformVersion,
733+
OSVersion: testconstants.OSVersion,
734+
CertificationRoute: testconstants.CertificationRoute,
735+
ProgramType: testconstants.ProgramType,
736+
Transport: testconstants.Transport,
737+
ParentChild: testconstants.ParentChild1,
738+
CertificationIdOfSoftwareComponent: testconstants.CertificationIDOfSoftwareComponent,
739+
Signer: certCenterAccount.Address,
739740
}
740741
_, err = suite.BuildAndBroadcastTx([]sdk.Msg{&certifyModelMsg}, certCenter, certCenterAccount)
741742
require.NoError(suite.T, err)
@@ -760,6 +761,7 @@ func DemoTrackCompliance(suite *utils.TestSuite) {
760761
require.Equal(suite.T, testconstants.CertificationRoute, complianceInfo.CertificationRoute)
761762
require.Equal(suite.T, testconstants.Transport, complianceInfo.Transport)
762763
require.Equal(suite.T, testconstants.ParentChild1, complianceInfo.ParentChild)
764+
require.Equal(suite.T, testconstants.CertificationIDOfSoftwareComponent, complianceInfo.CertificationIdOfSoftwareComponent)
763765

764766
modelIsCertified, _ = GetCertifiedModel(suite, vid, pid, sv, compliancetypes.ZigbeeCertificationType)
765767
require.True(suite.T, modelIsCertified.Value)
@@ -789,6 +791,7 @@ func DemoTrackCompliance(suite *utils.TestSuite) {
789791
require.Equal(suite.T, testconstants.CertificationRoute, deviceSoftwareCompliance.ComplianceInfo[0].CertificationRoute)
790792
require.Equal(suite.T, testconstants.Transport, deviceSoftwareCompliance.ComplianceInfo[0].Transport)
791793
require.Equal(suite.T, testconstants.ParentChild1, deviceSoftwareCompliance.ComplianceInfo[0].ParentChild)
794+
require.Equal(suite.T, testconstants.CertificationIDOfSoftwareComponent, deviceSoftwareCompliance.ComplianceInfo[0].CertificationIdOfSoftwareComponent)
792795

793796
// Get all models
794797
complianceInfos, _ = GetAllComplianceInfo(suite)
@@ -1165,25 +1168,26 @@ func DemoTrackProvision(suite *utils.TestSuite) {
11651168
// Provision non-existent model with all optional fields
11661169
provReason = "some reason 8"
11671170
provModelMsg = compliancetypes.MsgProvisionModel{
1168-
Vid: vid,
1169-
Pid: pid,
1170-
SoftwareVersion: sv,
1171-
SoftwareVersionString: svs,
1172-
ProvisionalDate: provDate,
1173-
CertificationType: "matter",
1174-
Reason: provReason,
1175-
CDCertificateId: testconstants.CDCertificateID,
1176-
ProgramTypeVersion: testconstants.ProgramTypeVersion,
1177-
FamilyId: testconstants.FamilyID,
1178-
SupportedClusters: testconstants.SupportedClusters,
1179-
CompliantPlatformUsed: testconstants.CompliantPlatformUsed,
1180-
CompliantPlatformVersion: testconstants.CompliantPlatformVersion,
1181-
OSVersion: testconstants.OSVersion,
1182-
CertificationRoute: testconstants.CertificationRoute,
1183-
ProgramType: testconstants.ProgramType,
1184-
Transport: testconstants.Transport,
1185-
ParentChild: testconstants.ParentChild1,
1186-
Signer: certCenterAccount.Address,
1171+
Vid: vid,
1172+
Pid: pid,
1173+
SoftwareVersion: sv,
1174+
SoftwareVersionString: svs,
1175+
ProvisionalDate: provDate,
1176+
CertificationType: "matter",
1177+
Reason: provReason,
1178+
CDCertificateId: testconstants.CDCertificateID,
1179+
ProgramTypeVersion: testconstants.ProgramTypeVersion,
1180+
FamilyId: testconstants.FamilyID,
1181+
SupportedClusters: testconstants.SupportedClusters,
1182+
CompliantPlatformUsed: testconstants.CompliantPlatformUsed,
1183+
CompliantPlatformVersion: testconstants.CompliantPlatformVersion,
1184+
OSVersion: testconstants.OSVersion,
1185+
CertificationRoute: testconstants.CertificationRoute,
1186+
ProgramType: testconstants.ProgramType,
1187+
Transport: testconstants.Transport,
1188+
ParentChild: testconstants.ParentChild1,
1189+
CertificationIdOfSoftwareComponent: testconstants.CertificationIDOfSoftwareComponent,
1190+
Signer: certCenterAccount.Address,
11871191
}
11881192
_, err = suite.BuildAndBroadcastTx([]sdk.Msg{&provModelMsg}, certCenter, certCenterAccount)
11891193
require.NoError(suite.T, err)
@@ -1208,6 +1212,7 @@ func DemoTrackProvision(suite *utils.TestSuite) {
12081212
require.Equal(suite.T, testconstants.CertificationRoute, complianceInfo.CertificationRoute)
12091213
require.Equal(suite.T, testconstants.Transport, complianceInfo.Transport)
12101214
require.Equal(suite.T, testconstants.ParentChild1, complianceInfo.ParentChild)
1215+
require.Equal(suite.T, testconstants.CertificationIDOfSoftwareComponent, complianceInfo.CertificationIdOfSoftwareComponent)
12111216

12121217
_, err = GetCertifiedModel(suite, vid, pid, sv, compliancetypes.MatterCertificationType)
12131218
suite.AssertNotFound(err)
@@ -1241,20 +1246,21 @@ func DemoTrackProvision(suite *utils.TestSuite) {
12411246
// Certify model with some optional fields
12421247
certReason = "some reason 9"
12431248
certifyModelMsg = compliancetypes.MsgCertifyModel{
1244-
Vid: vid,
1245-
Pid: pid,
1246-
SoftwareVersion: sv,
1247-
SoftwareVersionString: svs,
1248-
CertificationDate: certDate,
1249-
CertificationType: "matter",
1250-
Reason: certReason,
1251-
CDCertificateId: testconstants.CDCertificateID,
1252-
ProgramTypeVersion: "pTypeVersion",
1253-
FamilyId: "familyID",
1254-
SupportedClusters: "sClusters",
1255-
CompliantPlatformUsed: "WIFI",
1256-
CompliantPlatformVersion: "V1",
1257-
Signer: certCenterAccount.Address,
1249+
Vid: vid,
1250+
Pid: pid,
1251+
SoftwareVersion: sv,
1252+
SoftwareVersionString: svs,
1253+
CertificationDate: certDate,
1254+
CertificationType: "matter",
1255+
Reason: certReason,
1256+
CDCertificateId: testconstants.CDCertificateID,
1257+
ProgramTypeVersion: "pTypeVersion",
1258+
FamilyId: "familyID",
1259+
SupportedClusters: "sClusters",
1260+
CompliantPlatformUsed: "WIFI",
1261+
CompliantPlatformVersion: "V1",
1262+
CertificationIdOfSoftwareComponent: "x5732",
1263+
Signer: certCenterAccount.Address,
12581264
}
12591265
_, err = suite.BuildAndBroadcastTx([]sdk.Msg{&certifyModelMsg}, certCenter, certCenterAccount)
12601266
require.NoError(suite.T, err)
@@ -1276,6 +1282,7 @@ func DemoTrackProvision(suite *utils.TestSuite) {
12761282
require.Equal(suite.T, "sClusters", complianceInfo.SupportedClusters)
12771283
require.Equal(suite.T, "WIFI", complianceInfo.CompliantPlatformUsed)
12781284
require.Equal(suite.T, "V1", complianceInfo.CompliantPlatformVersion)
1285+
require.Equal(suite.T, "x5732", complianceInfo.CertificationIdOfSoftwareComponent)
12791286
require.Equal(suite.T, testconstants.OSVersion, complianceInfo.OSVersion)
12801287
require.Equal(suite.T, testconstants.CertificationRoute, complianceInfo.CertificationRoute)
12811288
require.Equal(suite.T, testconstants.Transport, complianceInfo.Transport)
@@ -1305,6 +1312,7 @@ func DemoTrackProvision(suite *utils.TestSuite) {
13051312
require.Equal(suite.T, "sClusters", deviceSoftwareCompliance.ComplianceInfo[3].SupportedClusters)
13061313
require.Equal(suite.T, "WIFI", deviceSoftwareCompliance.ComplianceInfo[3].CompliantPlatformUsed)
13071314
require.Equal(suite.T, "V1", deviceSoftwareCompliance.ComplianceInfo[3].CompliantPlatformVersion)
1315+
require.Equal(suite.T, "x5732", deviceSoftwareCompliance.ComplianceInfo[3].CertificationIdOfSoftwareComponent)
13081316
require.Equal(suite.T, testconstants.OSVersion, deviceSoftwareCompliance.ComplianceInfo[3].OSVersion)
13091317
require.Equal(suite.T, testconstants.CertificationRoute, deviceSoftwareCompliance.ComplianceInfo[3].CertificationRoute)
13101318
require.Equal(suite.T, testconstants.Transport, deviceSoftwareCompliance.ComplianceInfo[3].Transport)

0 commit comments

Comments
 (0)