@itentialopensource/adapter-apic 0.12.2 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CALLS.md +138 -0
- package/PROPERTIES.md +16 -1
- package/adapter.js +2078 -0
- package/adapterBase.js +38 -0
- package/entities/ApplicationProfileOperations/action.json +25 -0
- package/entities/ApplicationProfileOperations/schema.json +19 -0
- package/entities/BridgeDomainOperations/action.json +65 -0
- package/entities/BridgeDomainOperations/schema.json +21 -0
- package/entities/EPGOperations/action.json +86 -0
- package/entities/EPGOperations/schema.json +33 -0
- package/entities/TenantOperations/action.json +87 -0
- package/entities/TenantOperations/schema.json +22 -0
- package/entities/VLANPoolOperations/action.json +147 -0
- package/entities/VLANPoolOperations/schema.json +25 -0
- package/entities/VMMDomainOperations/action.json +46 -0
- package/entities/VMMDomainOperations/schema.json +31 -0
- package/entities/VRFOperations/action.json +45 -0
- package/entities/VRFOperations/schema.json +20 -0
- package/package.json +4 -4
- package/pronghorn.json +1104 -2
- package/propertiesSchema.json +41 -3
- package/report/adapterInfo.json +7 -7
- package/report/cisco-aci-apic-openapi.json +801 -0
- package/report/updateReport1764798882161.json +120 -0
- package/sampleProperties.json +4 -1
- package/test/integration/adapterTestIntegration.js +585 -0
- package/test/unit/adapterBaseTestUnit.js +1 -1
- package/test/unit/adapterTestUnit.js +826 -0
|
@@ -593,5 +593,590 @@ describe('[integration] Apic Adapter Test', () => {
|
|
|
593
593
|
}
|
|
594
594
|
}).timeout(attemptTimeout);
|
|
595
595
|
});
|
|
596
|
+
|
|
597
|
+
describe('#getAllTenants - errors', () => {
|
|
598
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
599
|
+
try {
|
|
600
|
+
a.getAllTenants(null, (data, error) => {
|
|
601
|
+
try {
|
|
602
|
+
if (stub) {
|
|
603
|
+
const displayE = 'Error 400 received on request';
|
|
604
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-apic-connectorRest-handleEndResponse', displayE);
|
|
605
|
+
} else {
|
|
606
|
+
runCommonAsserts(data, error);
|
|
607
|
+
}
|
|
608
|
+
saveMockData('TenantOperations', 'getAllTenants', 'default', data);
|
|
609
|
+
done();
|
|
610
|
+
} catch (err) {
|
|
611
|
+
log.error(`Test Failure: ${err}`);
|
|
612
|
+
done(err);
|
|
613
|
+
}
|
|
614
|
+
});
|
|
615
|
+
} catch (error) {
|
|
616
|
+
log.error(`Adapter Exception: ${error}`);
|
|
617
|
+
done(error);
|
|
618
|
+
}
|
|
619
|
+
}).timeout(attemptTimeout);
|
|
620
|
+
});
|
|
621
|
+
|
|
622
|
+
describe('#getTenant - errors', () => {
|
|
623
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
624
|
+
try {
|
|
625
|
+
a.getTenant('fakedata', null, (data, error) => {
|
|
626
|
+
try {
|
|
627
|
+
if (stub) {
|
|
628
|
+
const displayE = 'Error 400 received on request';
|
|
629
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-apic-connectorRest-handleEndResponse', displayE);
|
|
630
|
+
} else {
|
|
631
|
+
runCommonAsserts(data, error);
|
|
632
|
+
}
|
|
633
|
+
saveMockData('TenantOperations', 'getTenant', 'default', data);
|
|
634
|
+
done();
|
|
635
|
+
} catch (err) {
|
|
636
|
+
log.error(`Test Failure: ${err}`);
|
|
637
|
+
done(err);
|
|
638
|
+
}
|
|
639
|
+
});
|
|
640
|
+
} catch (error) {
|
|
641
|
+
log.error(`Adapter Exception: ${error}`);
|
|
642
|
+
done(error);
|
|
643
|
+
}
|
|
644
|
+
}).timeout(attemptTimeout);
|
|
645
|
+
});
|
|
646
|
+
|
|
647
|
+
describe('#getTenantWithFullSubtree - errors', () => {
|
|
648
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
649
|
+
try {
|
|
650
|
+
a.getTenantWithFullSubtree('fakedata', null, (data, error) => {
|
|
651
|
+
try {
|
|
652
|
+
if (stub) {
|
|
653
|
+
const displayE = 'Error 400 received on request';
|
|
654
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-apic-connectorRest-handleEndResponse', displayE);
|
|
655
|
+
} else {
|
|
656
|
+
runCommonAsserts(data, error);
|
|
657
|
+
}
|
|
658
|
+
saveMockData('TenantOperations', 'getTenantWithFullSubtree', 'default', data);
|
|
659
|
+
done();
|
|
660
|
+
} catch (err) {
|
|
661
|
+
log.error(`Test Failure: ${err}`);
|
|
662
|
+
done(err);
|
|
663
|
+
}
|
|
664
|
+
});
|
|
665
|
+
} catch (error) {
|
|
666
|
+
log.error(`Adapter Exception: ${error}`);
|
|
667
|
+
done(error);
|
|
668
|
+
}
|
|
669
|
+
}).timeout(attemptTimeout);
|
|
670
|
+
});
|
|
671
|
+
|
|
672
|
+
const tenantOperationsCreateTenantOrEnvironmentBodyParam = {};
|
|
673
|
+
describe('#createTenantOrEnvironment - errors', () => {
|
|
674
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
675
|
+
try {
|
|
676
|
+
a.createTenantOrEnvironment(tenantOperationsCreateTenantOrEnvironmentBodyParam, null, (data, error) => {
|
|
677
|
+
try {
|
|
678
|
+
if (stub) {
|
|
679
|
+
const displayE = 'Error 400 received on request';
|
|
680
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-apic-connectorRest-handleEndResponse', displayE);
|
|
681
|
+
} else {
|
|
682
|
+
runCommonAsserts(data, error);
|
|
683
|
+
}
|
|
684
|
+
saveMockData('TenantOperations', 'createTenantOrEnvironment', 'default', data);
|
|
685
|
+
done();
|
|
686
|
+
} catch (err) {
|
|
687
|
+
log.error(`Test Failure: ${err}`);
|
|
688
|
+
done(err);
|
|
689
|
+
}
|
|
690
|
+
});
|
|
691
|
+
} catch (error) {
|
|
692
|
+
log.error(`Adapter Exception: ${error}`);
|
|
693
|
+
done(error);
|
|
694
|
+
}
|
|
695
|
+
}).timeout(attemptTimeout);
|
|
696
|
+
});
|
|
697
|
+
|
|
698
|
+
const vRFOperationsCreateTenantResourceBodyParam = {};
|
|
699
|
+
describe('#createTenantResource - errors', () => {
|
|
700
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
701
|
+
try {
|
|
702
|
+
a.createTenantResource('fakedata', vRFOperationsCreateTenantResourceBodyParam, null, (data, error) => {
|
|
703
|
+
try {
|
|
704
|
+
if (stub) {
|
|
705
|
+
const displayE = 'Error 400 received on request';
|
|
706
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-apic-connectorRest-handleEndResponse', displayE);
|
|
707
|
+
} else {
|
|
708
|
+
runCommonAsserts(data, error);
|
|
709
|
+
}
|
|
710
|
+
saveMockData('VRFOperations', 'createTenantResource', 'default', data);
|
|
711
|
+
done();
|
|
712
|
+
} catch (err) {
|
|
713
|
+
log.error(`Test Failure: ${err}`);
|
|
714
|
+
done(err);
|
|
715
|
+
}
|
|
716
|
+
});
|
|
717
|
+
} catch (error) {
|
|
718
|
+
log.error(`Adapter Exception: ${error}`);
|
|
719
|
+
done(error);
|
|
720
|
+
}
|
|
721
|
+
}).timeout(attemptTimeout);
|
|
722
|
+
});
|
|
723
|
+
|
|
724
|
+
describe('#getAllVRFs - errors', () => {
|
|
725
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
726
|
+
try {
|
|
727
|
+
a.getAllVRFs(null, (data, error) => {
|
|
728
|
+
try {
|
|
729
|
+
if (stub) {
|
|
730
|
+
const displayE = 'Error 400 received on request';
|
|
731
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-apic-connectorRest-handleEndResponse', displayE);
|
|
732
|
+
} else {
|
|
733
|
+
runCommonAsserts(data, error);
|
|
734
|
+
}
|
|
735
|
+
saveMockData('VRFOperations', 'getAllVRFs', 'default', data);
|
|
736
|
+
done();
|
|
737
|
+
} catch (err) {
|
|
738
|
+
log.error(`Test Failure: ${err}`);
|
|
739
|
+
done(err);
|
|
740
|
+
}
|
|
741
|
+
});
|
|
742
|
+
} catch (error) {
|
|
743
|
+
log.error(`Adapter Exception: ${error}`);
|
|
744
|
+
done(error);
|
|
745
|
+
}
|
|
746
|
+
}).timeout(attemptTimeout);
|
|
747
|
+
});
|
|
748
|
+
|
|
749
|
+
describe('#getAllBridgeDomains - errors', () => {
|
|
750
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
751
|
+
try {
|
|
752
|
+
a.getAllBridgeDomains(null, (data, error) => {
|
|
753
|
+
try {
|
|
754
|
+
if (stub) {
|
|
755
|
+
const displayE = 'Error 400 received on request';
|
|
756
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-apic-connectorRest-handleEndResponse', displayE);
|
|
757
|
+
} else {
|
|
758
|
+
runCommonAsserts(data, error);
|
|
759
|
+
}
|
|
760
|
+
saveMockData('BridgeDomainOperations', 'getAllBridgeDomains', 'default', data);
|
|
761
|
+
done();
|
|
762
|
+
} catch (err) {
|
|
763
|
+
log.error(`Test Failure: ${err}`);
|
|
764
|
+
done(err);
|
|
765
|
+
}
|
|
766
|
+
});
|
|
767
|
+
} catch (error) {
|
|
768
|
+
log.error(`Adapter Exception: ${error}`);
|
|
769
|
+
done(error);
|
|
770
|
+
}
|
|
771
|
+
}).timeout(attemptTimeout);
|
|
772
|
+
});
|
|
773
|
+
|
|
774
|
+
const bridgeDomainOperationsCreateDHCPRelayPolicyBodyParam = {};
|
|
775
|
+
describe('#createDHCPRelayPolicy - errors', () => {
|
|
776
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
777
|
+
try {
|
|
778
|
+
a.createDHCPRelayPolicy('fakedata', 'fakedata', bridgeDomainOperationsCreateDHCPRelayPolicyBodyParam, null, (data, error) => {
|
|
779
|
+
try {
|
|
780
|
+
if (stub) {
|
|
781
|
+
const displayE = 'Error 400 received on request';
|
|
782
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-apic-connectorRest-handleEndResponse', displayE);
|
|
783
|
+
} else {
|
|
784
|
+
runCommonAsserts(data, error);
|
|
785
|
+
}
|
|
786
|
+
saveMockData('BridgeDomainOperations', 'createDHCPRelayPolicy', 'default', data);
|
|
787
|
+
done();
|
|
788
|
+
} catch (err) {
|
|
789
|
+
log.error(`Test Failure: ${err}`);
|
|
790
|
+
done(err);
|
|
791
|
+
}
|
|
792
|
+
});
|
|
793
|
+
} catch (error) {
|
|
794
|
+
log.error(`Adapter Exception: ${error}`);
|
|
795
|
+
done(error);
|
|
796
|
+
}
|
|
797
|
+
}).timeout(attemptTimeout);
|
|
798
|
+
});
|
|
799
|
+
|
|
800
|
+
const bridgeDomainOperationsAssociateDHCPRelayToBDBodyParam = {};
|
|
801
|
+
describe('#associateDHCPRelayToBD - errors', () => {
|
|
802
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
803
|
+
try {
|
|
804
|
+
a.associateDHCPRelayToBD('fakedata', 'fakedata', bridgeDomainOperationsAssociateDHCPRelayToBDBodyParam, null, (data, error) => {
|
|
805
|
+
try {
|
|
806
|
+
if (stub) {
|
|
807
|
+
const displayE = 'Error 400 received on request';
|
|
808
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-apic-connectorRest-handleEndResponse', displayE);
|
|
809
|
+
} else {
|
|
810
|
+
runCommonAsserts(data, error);
|
|
811
|
+
}
|
|
812
|
+
saveMockData('BridgeDomainOperations', 'associateDHCPRelayToBD', 'default', data);
|
|
813
|
+
done();
|
|
814
|
+
} catch (err) {
|
|
815
|
+
log.error(`Test Failure: ${err}`);
|
|
816
|
+
done(err);
|
|
817
|
+
}
|
|
818
|
+
});
|
|
819
|
+
} catch (error) {
|
|
820
|
+
log.error(`Adapter Exception: ${error}`);
|
|
821
|
+
done(error);
|
|
822
|
+
}
|
|
823
|
+
}).timeout(attemptTimeout);
|
|
824
|
+
});
|
|
825
|
+
|
|
826
|
+
describe('#getAllApplicationProfiles - errors', () => {
|
|
827
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
828
|
+
try {
|
|
829
|
+
a.getAllApplicationProfiles(null, (data, error) => {
|
|
830
|
+
try {
|
|
831
|
+
if (stub) {
|
|
832
|
+
const displayE = 'Error 400 received on request';
|
|
833
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-apic-connectorRest-handleEndResponse', displayE);
|
|
834
|
+
} else {
|
|
835
|
+
runCommonAsserts(data, error);
|
|
836
|
+
}
|
|
837
|
+
saveMockData('ApplicationProfileOperations', 'getAllApplicationProfiles', 'default', data);
|
|
838
|
+
done();
|
|
839
|
+
} catch (err) {
|
|
840
|
+
log.error(`Test Failure: ${err}`);
|
|
841
|
+
done(err);
|
|
842
|
+
}
|
|
843
|
+
});
|
|
844
|
+
} catch (error) {
|
|
845
|
+
log.error(`Adapter Exception: ${error}`);
|
|
846
|
+
done(error);
|
|
847
|
+
}
|
|
848
|
+
}).timeout(attemptTimeout);
|
|
849
|
+
});
|
|
850
|
+
|
|
851
|
+
describe('#getAllEPGs - errors', () => {
|
|
852
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
853
|
+
try {
|
|
854
|
+
a.getAllEPGs(null, (data, error) => {
|
|
855
|
+
try {
|
|
856
|
+
if (stub) {
|
|
857
|
+
const displayE = 'Error 400 received on request';
|
|
858
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-apic-connectorRest-handleEndResponse', displayE);
|
|
859
|
+
} else {
|
|
860
|
+
runCommonAsserts(data, error);
|
|
861
|
+
}
|
|
862
|
+
saveMockData('EPGOperations', 'getAllEPGs', 'default', data);
|
|
863
|
+
done();
|
|
864
|
+
} catch (err) {
|
|
865
|
+
log.error(`Test Failure: ${err}`);
|
|
866
|
+
done(err);
|
|
867
|
+
}
|
|
868
|
+
});
|
|
869
|
+
} catch (error) {
|
|
870
|
+
log.error(`Adapter Exception: ${error}`);
|
|
871
|
+
done(error);
|
|
872
|
+
}
|
|
873
|
+
}).timeout(attemptTimeout);
|
|
874
|
+
});
|
|
875
|
+
|
|
876
|
+
describe('#getEPGsInTenant - errors', () => {
|
|
877
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
878
|
+
try {
|
|
879
|
+
a.getEPGsInTenant('fakedata', null, (data, error) => {
|
|
880
|
+
try {
|
|
881
|
+
if (stub) {
|
|
882
|
+
const displayE = 'Error 400 received on request';
|
|
883
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-apic-connectorRest-handleEndResponse', displayE);
|
|
884
|
+
} else {
|
|
885
|
+
runCommonAsserts(data, error);
|
|
886
|
+
}
|
|
887
|
+
saveMockData('EPGOperations', 'getEPGsInTenant', 'default', data);
|
|
888
|
+
done();
|
|
889
|
+
} catch (err) {
|
|
890
|
+
log.error(`Test Failure: ${err}`);
|
|
891
|
+
done(err);
|
|
892
|
+
}
|
|
893
|
+
});
|
|
894
|
+
} catch (error) {
|
|
895
|
+
log.error(`Adapter Exception: ${error}`);
|
|
896
|
+
done(error);
|
|
897
|
+
}
|
|
898
|
+
}).timeout(attemptTimeout);
|
|
899
|
+
});
|
|
900
|
+
|
|
901
|
+
const ePGOperationsCreateEPGWithVMMBodyParam = {};
|
|
902
|
+
describe('#createEPGWithVMM - errors', () => {
|
|
903
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
904
|
+
try {
|
|
905
|
+
a.createEPGWithVMM('fakedata', 'fakedata', ePGOperationsCreateEPGWithVMMBodyParam, null, (data, error) => {
|
|
906
|
+
try {
|
|
907
|
+
if (stub) {
|
|
908
|
+
const displayE = 'Error 400 received on request';
|
|
909
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-apic-connectorRest-handleEndResponse', displayE);
|
|
910
|
+
} else {
|
|
911
|
+
runCommonAsserts(data, error);
|
|
912
|
+
}
|
|
913
|
+
saveMockData('EPGOperations', 'createEPGWithVMM', 'default', data);
|
|
914
|
+
done();
|
|
915
|
+
} catch (err) {
|
|
916
|
+
log.error(`Test Failure: ${err}`);
|
|
917
|
+
done(err);
|
|
918
|
+
}
|
|
919
|
+
});
|
|
920
|
+
} catch (error) {
|
|
921
|
+
log.error(`Adapter Exception: ${error}`);
|
|
922
|
+
done(error);
|
|
923
|
+
}
|
|
924
|
+
}).timeout(attemptTimeout);
|
|
925
|
+
});
|
|
926
|
+
|
|
927
|
+
const ePGOperationsAssociateEPGWithVMMBodyParam = {};
|
|
928
|
+
describe('#associateEPGWithVMM - errors', () => {
|
|
929
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
930
|
+
try {
|
|
931
|
+
a.associateEPGWithVMM('fakedata', 'fakedata', 'fakedata', ePGOperationsAssociateEPGWithVMMBodyParam, null, (data, error) => {
|
|
932
|
+
try {
|
|
933
|
+
if (stub) {
|
|
934
|
+
const displayE = 'Error 400 received on request';
|
|
935
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-apic-connectorRest-handleEndResponse', displayE);
|
|
936
|
+
} else {
|
|
937
|
+
runCommonAsserts(data, error);
|
|
938
|
+
}
|
|
939
|
+
saveMockData('EPGOperations', 'associateEPGWithVMM', 'default', data);
|
|
940
|
+
done();
|
|
941
|
+
} catch (err) {
|
|
942
|
+
log.error(`Test Failure: ${err}`);
|
|
943
|
+
done(err);
|
|
944
|
+
}
|
|
945
|
+
});
|
|
946
|
+
} catch (error) {
|
|
947
|
+
log.error(`Adapter Exception: ${error}`);
|
|
948
|
+
done(error);
|
|
949
|
+
}
|
|
950
|
+
}).timeout(attemptTimeout);
|
|
951
|
+
});
|
|
952
|
+
|
|
953
|
+
describe('#getAllVMMDomains - errors', () => {
|
|
954
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
955
|
+
try {
|
|
956
|
+
a.getAllVMMDomains(null, (data, error) => {
|
|
957
|
+
try {
|
|
958
|
+
if (stub) {
|
|
959
|
+
const displayE = 'Error 400 received on request';
|
|
960
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-apic-connectorRest-handleEndResponse', displayE);
|
|
961
|
+
} else {
|
|
962
|
+
runCommonAsserts(data, error);
|
|
963
|
+
}
|
|
964
|
+
saveMockData('VMMDomainOperations', 'getAllVMMDomains', 'default', data);
|
|
965
|
+
done();
|
|
966
|
+
} catch (err) {
|
|
967
|
+
log.error(`Test Failure: ${err}`);
|
|
968
|
+
done(err);
|
|
969
|
+
}
|
|
970
|
+
});
|
|
971
|
+
} catch (error) {
|
|
972
|
+
log.error(`Adapter Exception: ${error}`);
|
|
973
|
+
done(error);
|
|
974
|
+
}
|
|
975
|
+
}).timeout(attemptTimeout);
|
|
976
|
+
});
|
|
977
|
+
|
|
978
|
+
describe('#getVMwareVMMDomains - errors', () => {
|
|
979
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
980
|
+
try {
|
|
981
|
+
a.getVMwareVMMDomains('fakedata', null, (data, error) => {
|
|
982
|
+
try {
|
|
983
|
+
if (stub) {
|
|
984
|
+
const displayE = 'Error 400 received on request';
|
|
985
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-apic-connectorRest-handleEndResponse', displayE);
|
|
986
|
+
} else {
|
|
987
|
+
runCommonAsserts(data, error);
|
|
988
|
+
}
|
|
989
|
+
saveMockData('VMMDomainOperations', 'getVMwareVMMDomains', 'default', data);
|
|
990
|
+
done();
|
|
991
|
+
} catch (err) {
|
|
992
|
+
log.error(`Test Failure: ${err}`);
|
|
993
|
+
done(err);
|
|
994
|
+
}
|
|
995
|
+
});
|
|
996
|
+
} catch (error) {
|
|
997
|
+
log.error(`Adapter Exception: ${error}`);
|
|
998
|
+
done(error);
|
|
999
|
+
}
|
|
1000
|
+
}).timeout(attemptTimeout);
|
|
1001
|
+
});
|
|
1002
|
+
|
|
1003
|
+
describe('#getAllVLANPools - errors', () => {
|
|
1004
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
1005
|
+
try {
|
|
1006
|
+
a.getAllVLANPools(null, (data, error) => {
|
|
1007
|
+
try {
|
|
1008
|
+
if (stub) {
|
|
1009
|
+
const displayE = 'Error 400 received on request';
|
|
1010
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-apic-connectorRest-handleEndResponse', displayE);
|
|
1011
|
+
} else {
|
|
1012
|
+
runCommonAsserts(data, error);
|
|
1013
|
+
}
|
|
1014
|
+
saveMockData('VLANPoolOperations', 'getAllVLANPools', 'default', data);
|
|
1015
|
+
done();
|
|
1016
|
+
} catch (err) {
|
|
1017
|
+
log.error(`Test Failure: ${err}`);
|
|
1018
|
+
done(err);
|
|
1019
|
+
}
|
|
1020
|
+
});
|
|
1021
|
+
} catch (error) {
|
|
1022
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1023
|
+
done(error);
|
|
1024
|
+
}
|
|
1025
|
+
}).timeout(attemptTimeout);
|
|
1026
|
+
});
|
|
1027
|
+
|
|
1028
|
+
const vLANPoolOperationsCreateDynamicVLANPoolBodyParam = {};
|
|
1029
|
+
describe('#createDynamicVLANPool - errors', () => {
|
|
1030
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
1031
|
+
try {
|
|
1032
|
+
a.createDynamicVLANPool('fakedata', vLANPoolOperationsCreateDynamicVLANPoolBodyParam, null, (data, error) => {
|
|
1033
|
+
try {
|
|
1034
|
+
if (stub) {
|
|
1035
|
+
const displayE = 'Error 400 received on request';
|
|
1036
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-apic-connectorRest-handleEndResponse', displayE);
|
|
1037
|
+
} else {
|
|
1038
|
+
runCommonAsserts(data, error);
|
|
1039
|
+
}
|
|
1040
|
+
saveMockData('VLANPoolOperations', 'createDynamicVLANPool', 'default', data);
|
|
1041
|
+
done();
|
|
1042
|
+
} catch (err) {
|
|
1043
|
+
log.error(`Test Failure: ${err}`);
|
|
1044
|
+
done(err);
|
|
1045
|
+
}
|
|
1046
|
+
});
|
|
1047
|
+
} catch (error) {
|
|
1048
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1049
|
+
done(error);
|
|
1050
|
+
}
|
|
1051
|
+
}).timeout(attemptTimeout);
|
|
1052
|
+
});
|
|
1053
|
+
|
|
1054
|
+
describe('#getVLANPoolDetails - errors', () => {
|
|
1055
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
1056
|
+
try {
|
|
1057
|
+
a.getVLANPoolDetails('fakedata', null, (data, error) => {
|
|
1058
|
+
try {
|
|
1059
|
+
if (stub) {
|
|
1060
|
+
const displayE = 'Error 400 received on request';
|
|
1061
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-apic-connectorRest-handleEndResponse', displayE);
|
|
1062
|
+
} else {
|
|
1063
|
+
runCommonAsserts(data, error);
|
|
1064
|
+
}
|
|
1065
|
+
saveMockData('VLANPoolOperations', 'getVLANPoolDetails', 'default', data);
|
|
1066
|
+
done();
|
|
1067
|
+
} catch (err) {
|
|
1068
|
+
log.error(`Test Failure: ${err}`);
|
|
1069
|
+
done(err);
|
|
1070
|
+
}
|
|
1071
|
+
});
|
|
1072
|
+
} catch (error) {
|
|
1073
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1074
|
+
done(error);
|
|
1075
|
+
}
|
|
1076
|
+
}).timeout(attemptTimeout);
|
|
1077
|
+
});
|
|
1078
|
+
|
|
1079
|
+
const vLANPoolOperationsCreateStaticVLANPoolBodyParam = {};
|
|
1080
|
+
describe('#createStaticVLANPool - errors', () => {
|
|
1081
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
1082
|
+
try {
|
|
1083
|
+
a.createStaticVLANPool('fakedata', vLANPoolOperationsCreateStaticVLANPoolBodyParam, null, (data, error) => {
|
|
1084
|
+
try {
|
|
1085
|
+
if (stub) {
|
|
1086
|
+
const displayE = 'Error 400 received on request';
|
|
1087
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-apic-connectorRest-handleEndResponse', displayE);
|
|
1088
|
+
} else {
|
|
1089
|
+
runCommonAsserts(data, error);
|
|
1090
|
+
}
|
|
1091
|
+
saveMockData('VLANPoolOperations', 'createStaticVLANPool', 'default', data);
|
|
1092
|
+
done();
|
|
1093
|
+
} catch (err) {
|
|
1094
|
+
log.error(`Test Failure: ${err}`);
|
|
1095
|
+
done(err);
|
|
1096
|
+
}
|
|
1097
|
+
});
|
|
1098
|
+
} catch (error) {
|
|
1099
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1100
|
+
done(error);
|
|
1101
|
+
}
|
|
1102
|
+
}).timeout(attemptTimeout);
|
|
1103
|
+
});
|
|
1104
|
+
|
|
1105
|
+
const vLANPoolOperationsAssociateVLANPoolWithVMMBodyParam = {};
|
|
1106
|
+
describe('#associateVLANPoolWithVMM - errors', () => {
|
|
1107
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
1108
|
+
try {
|
|
1109
|
+
a.associateVLANPoolWithVMM('fakedata', vLANPoolOperationsAssociateVLANPoolWithVMMBodyParam, null, (data, error) => {
|
|
1110
|
+
try {
|
|
1111
|
+
if (stub) {
|
|
1112
|
+
const displayE = 'Error 400 received on request';
|
|
1113
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-apic-connectorRest-handleEndResponse', displayE);
|
|
1114
|
+
} else {
|
|
1115
|
+
runCommonAsserts(data, error);
|
|
1116
|
+
}
|
|
1117
|
+
saveMockData('VLANPoolOperations', 'associateVLANPoolWithVMM', 'default', data);
|
|
1118
|
+
done();
|
|
1119
|
+
} catch (err) {
|
|
1120
|
+
log.error(`Test Failure: ${err}`);
|
|
1121
|
+
done(err);
|
|
1122
|
+
}
|
|
1123
|
+
});
|
|
1124
|
+
} catch (error) {
|
|
1125
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1126
|
+
done(error);
|
|
1127
|
+
}
|
|
1128
|
+
}).timeout(attemptTimeout);
|
|
1129
|
+
});
|
|
1130
|
+
|
|
1131
|
+
describe('#getVMMDomainVLANPoolAssociation - errors', () => {
|
|
1132
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
1133
|
+
try {
|
|
1134
|
+
a.getVMMDomainVLANPoolAssociation('fakedata', null, (data, error) => {
|
|
1135
|
+
try {
|
|
1136
|
+
if (stub) {
|
|
1137
|
+
const displayE = 'Error 400 received on request';
|
|
1138
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-apic-connectorRest-handleEndResponse', displayE);
|
|
1139
|
+
} else {
|
|
1140
|
+
runCommonAsserts(data, error);
|
|
1141
|
+
}
|
|
1142
|
+
saveMockData('VLANPoolOperations', 'getVMMDomainVLANPoolAssociation', 'default', data);
|
|
1143
|
+
done();
|
|
1144
|
+
} catch (err) {
|
|
1145
|
+
log.error(`Test Failure: ${err}`);
|
|
1146
|
+
done(err);
|
|
1147
|
+
}
|
|
1148
|
+
});
|
|
1149
|
+
} catch (error) {
|
|
1150
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1151
|
+
done(error);
|
|
1152
|
+
}
|
|
1153
|
+
}).timeout(attemptTimeout);
|
|
1154
|
+
});
|
|
1155
|
+
|
|
1156
|
+
const vLANPoolOperationsAddVLANRangeToPoolBodyParam = {};
|
|
1157
|
+
describe('#addVLANRangeToPool - errors', () => {
|
|
1158
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
1159
|
+
try {
|
|
1160
|
+
a.addVLANRangeToPool('fakedata', 'fakedata', 'fakedata', vLANPoolOperationsAddVLANRangeToPoolBodyParam, null, (data, error) => {
|
|
1161
|
+
try {
|
|
1162
|
+
if (stub) {
|
|
1163
|
+
const displayE = 'Error 400 received on request';
|
|
1164
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-apic-connectorRest-handleEndResponse', displayE);
|
|
1165
|
+
} else {
|
|
1166
|
+
runCommonAsserts(data, error);
|
|
1167
|
+
}
|
|
1168
|
+
saveMockData('VLANPoolOperations', 'addVLANRangeToPool', 'default', data);
|
|
1169
|
+
done();
|
|
1170
|
+
} catch (err) {
|
|
1171
|
+
log.error(`Test Failure: ${err}`);
|
|
1172
|
+
done(err);
|
|
1173
|
+
}
|
|
1174
|
+
});
|
|
1175
|
+
} catch (error) {
|
|
1176
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1177
|
+
done(error);
|
|
1178
|
+
}
|
|
1179
|
+
}).timeout(attemptTimeout);
|
|
1180
|
+
});
|
|
596
1181
|
});
|
|
597
1182
|
});
|
|
@@ -387,7 +387,7 @@ describe('[unit] Adapter Base Test', () => {
|
|
|
387
387
|
'healthCheck', 'iapActivateTasks', 'iapDeactivateTasks', 'iapExpandedGenericAdapterRequest', 'iapFindAdapterPath', 'iapGetAdapterInventory', 'iapGetAdapterQueue',
|
|
388
388
|
'iapGetAdapterWorkflowFunctions', 'iapGetDeviceCount', 'iapGetDeviceCountAuth', 'iapMoveAdapterEntitiesToDB', 'iapPopulateEntityCache', 'iapRetrieveEntitiesCache',
|
|
389
389
|
'iapRunAdapterBasicGet', 'iapRunAdapterConnectivity', 'iapRunAdapterHealthcheck', 'iapRunAdapterLint', 'iapRunAdapterTests', 'iapSuspendAdapter', 'iapTroubleshootAdapter',
|
|
390
|
-
'iapUnsuspendAdapter', 'iapUpdateAdapterConfiguration', 'isAlive', 'isAliveAuth', 'refreshProperties', 'addListener', 'emit', 'eventNames', 'getMaxListeners',
|
|
390
|
+
'iapUnsuspendAdapter', 'iapUpdateAdapterConfiguration', 'isAlive', 'isAliveAuth', 'parseIapMetadata', 'refreshProperties', 'addListener', 'emit', 'eventNames', 'getMaxListeners',
|
|
391
391
|
'listenerCount', 'listeners', 'off', 'on', 'once', 'prependListener', 'prependOnceListener', 'rawListeners', 'removeAllListeners', 'removeListener', 'setMaxListeners'];
|
|
392
392
|
try {
|
|
393
393
|
const expectedFunctions = a.getAllFunctions();
|