@itentialopensource/adapter-f5_bigiq 0.1.1 → 0.3.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.
Files changed (77) hide show
  1. package/AUTH.md +39 -0
  2. package/BROKER.md +199 -0
  3. package/CALLS.md +169 -0
  4. package/CHANGELOG.md +17 -2
  5. package/CODE_OF_CONDUCT.md +12 -17
  6. package/CONTRIBUTING.md +88 -74
  7. package/ENHANCE.md +69 -0
  8. package/PROPERTIES.md +641 -0
  9. package/README.md +223 -569
  10. package/SUMMARY.md +9 -0
  11. package/SYSTEMINFO.md +11 -0
  12. package/TROUBLESHOOT.md +47 -0
  13. package/adapter.js +6393 -60
  14. package/adapterBase.js +1021 -245
  15. package/entities/.generic/action.json +110 -5
  16. package/entities/.generic/schema.json +6 -1
  17. package/entities/BIGIPDeviceClustering/action.json +46 -0
  18. package/entities/BIGIPDeviceClustering/schema.json +20 -0
  19. package/entities/BIGIPDeviceReferenceLookup/action.json +25 -0
  20. package/entities/BIGIPDeviceReferenceLookup/schema.json +19 -0
  21. package/entities/BIGIPIHealth/action.json +313 -0
  22. package/entities/BIGIPIHealth/schema.json +33 -0
  23. package/entities/BIGIPSoftwareImageManagement/action.json +46 -0
  24. package/entities/BIGIPSoftwareImageManagement/schema.json +20 -0
  25. package/entities/BIGIPTMSHScripting/action.json +107 -0
  26. package/entities/BIGIPTMSHScripting/schema.json +23 -0
  27. package/entities/BIGIPUUIDLookup/action.json +25 -0
  28. package/entities/BIGIPUUIDLookup/schema.json +19 -0
  29. package/entities/BIGIQSystemClusterStatus/action.json +46 -0
  30. package/entities/BIGIQSystemClusterStatus/schema.json +20 -0
  31. package/entities/Configuration/action.json +24 -0
  32. package/entities/Configuration/schema.json +19 -0
  33. package/entities/Device/action.json +63 -0
  34. package/entities/Device/schema.json +4 -1
  35. package/entities/DeviceBackups/action.json +148 -0
  36. package/entities/DeviceBackups/schema.json +25 -0
  37. package/entities/DeviceImport/action.json +86 -0
  38. package/entities/DeviceImport/schema.json +22 -0
  39. package/entities/DeviceInfo/action.json +45 -0
  40. package/entities/DeviceInfo/schema.json +20 -0
  41. package/entities/DeviceUpgrades/action.json +45 -0
  42. package/entities/DeviceUpgrades/schema.json +20 -0
  43. package/entities/Licensing/action.json +66 -0
  44. package/entities/Licensing/schema.json +21 -0
  45. package/entities/Qkview/action.json +148 -0
  46. package/entities/Qkview/schema.json +25 -0
  47. package/entities/SSLManagement/action.json +330 -0
  48. package/entities/SSLManagement/schema.json +34 -0
  49. package/entities/SoftwareManagement/action.json +46 -0
  50. package/entities/SoftwareManagement/schema.json +20 -0
  51. package/error.json +6 -0
  52. package/package.json +17 -11
  53. package/pronghorn.json +3386 -578
  54. package/propertiesDecorators.json +14 -0
  55. package/propertiesSchema.json +422 -1
  56. package/refs?service=git-upload-pack +0 -0
  57. package/report/AdditionalF5.OpenApi3Json.json +3886 -0
  58. package/report/adapterInfo.json +10 -0
  59. package/report/updateReport1653154920166.json +120 -0
  60. package/sampleProperties.json +94 -3
  61. package/test/integration/adapterTestBasicGet.js +1 -1
  62. package/test/integration/adapterTestIntegration.js +2055 -105
  63. package/test/unit/adapterBaseTestUnit.js +30 -25
  64. package/test/unit/adapterTestUnit.js +1759 -200
  65. package/utils/adapterInfo.js +206 -0
  66. package/utils/addAuth.js +94 -0
  67. package/utils/artifactize.js +0 -0
  68. package/utils/basicGet.js +1 -14
  69. package/utils/entitiesToDB.js +179 -0
  70. package/utils/modify.js +1 -1
  71. package/utils/patches2bundledDeps.js +90 -0
  72. package/utils/pre-commit.sh +3 -0
  73. package/utils/removeHooks.js +20 -0
  74. package/utils/tbScript.js +43 -22
  75. package/utils/tbUtils.js +126 -29
  76. package/utils/testRunner.js +16 -16
  77. package/utils/troubleshootingAdapter.js +2 -26
@@ -3,6 +3,8 @@
3
3
  // Set globals
4
4
  /* global describe it log pronghornProps */
5
5
  /* eslint no-unused-vars: warn */
6
+ /* eslint no-underscore-dangle: warn */
7
+ /* eslint import/no-dynamic-require:warn */
6
8
 
7
9
  // include required items for testing & logging
8
10
  const assert = require('assert');
@@ -13,25 +15,39 @@ const winston = require('winston');
13
15
  const { expect } = require('chai');
14
16
  const { use } = require('chai');
15
17
  const td = require('testdouble');
18
+ const util = require('util');
16
19
 
17
20
  const anything = td.matchers.anything();
18
21
 
19
22
  // stub and attemptTimeout are used throughout the code so set them here
20
23
  let logLevel = 'none';
21
- const stub = true;
22
24
  const isRapidFail = false;
23
25
  const isSaveMockData = false;
24
- const attemptTimeout = 10000;
26
+
27
+ // read in the properties from the sampleProperties files
28
+ let adaptdir = __dirname;
29
+ if (adaptdir.endsWith('/test/integration')) {
30
+ adaptdir = adaptdir.substring(0, adaptdir.length - 17);
31
+ } else if (adaptdir.endsWith('/test/unit')) {
32
+ adaptdir = adaptdir.substring(0, adaptdir.length - 10);
33
+ }
34
+ const samProps = require(`${adaptdir}/sampleProperties.json`).properties;
25
35
 
26
36
  // these variables can be changed to run in integrated mode so easier to set them here
27
37
  // always check these in with bogus data!!!
28
- const host = 'replace.hostorip.here';
29
- const username = 'username';
30
- const password = 'password';
31
- const protocol = 'http';
32
- const port = 80;
33
- const sslenable = false;
34
- const sslinvalid = false;
38
+ samProps.stub = true;
39
+ samProps.host = 'replace.hostorip.here';
40
+ samProps.authentication.username = 'username';
41
+ samProps.authentication.password = 'password';
42
+ samProps.protocol = 'http';
43
+ samProps.port = 80;
44
+ samProps.ssl.enabled = false;
45
+ samProps.ssl.accept_invalid_cert = false;
46
+ if (samProps.request.attempt_timeout < 30000) {
47
+ samProps.request.attempt_timeout = 30000;
48
+ }
49
+ const attemptTimeout = samProps.request.attempt_timeout;
50
+ const { stub } = samProps;
35
51
 
36
52
  // these are the adapter properties. You generally should not need to alter
37
53
  // any of these after they are initially set up
@@ -43,102 +59,7 @@ global.pronghornProps = {
43
59
  adapters: [{
44
60
  id: 'Test-f5_bigiq',
45
61
  type: 'F5BigIQ',
46
- properties: {
47
- host,
48
- port,
49
- base_path: '/',
50
- version: '',
51
- cache_location: 'none',
52
- encode_pathvars: true,
53
- save_metric: false,
54
- stub,
55
- protocol,
56
- authentication: {
57
- auth_method: 'request_token',
58
- username,
59
- password,
60
- token: '',
61
- invalid_token_error: 401,
62
- token_timeout: 1800000,
63
- token_cache: 'local',
64
- auth_field: 'header.headers.X-AUTH-TOKEN',
65
- auth_field_format: '{token}',
66
- auth_logging: false,
67
- client_id: '',
68
- client_secret: '',
69
- grant_type: ''
70
- },
71
- healthcheck: {
72
- type: 'none',
73
- frequency: 60000,
74
- query_object: {}
75
- },
76
- throttle: {
77
- throttle_enabled: false,
78
- number_pronghorns: 1,
79
- sync_async: 'sync',
80
- max_in_queue: 1000,
81
- concurrent_max: 1,
82
- expire_timeout: 0,
83
- avg_runtime: 200,
84
- priorities: [
85
- {
86
- value: 0,
87
- percent: 100
88
- }
89
- ]
90
- },
91
- request: {
92
- number_redirects: 0,
93
- number_retries: 3,
94
- limit_retry_error: [0],
95
- failover_codes: [],
96
- attempt_timeout: attemptTimeout,
97
- global_request: {
98
- payload: {},
99
- uriOptions: {},
100
- addlHeaders: {},
101
- authData: {}
102
- },
103
- healthcheck_on_timeout: true,
104
- return_raw: true,
105
- archiving: false,
106
- return_request: false
107
- },
108
- proxy: {
109
- enabled: false,
110
- host: '',
111
- port: 1,
112
- protocol: 'http',
113
- username: '',
114
- password: ''
115
- },
116
- ssl: {
117
- ecdhCurve: '',
118
- enabled: sslenable,
119
- accept_invalid_cert: sslinvalid,
120
- ca_file: '',
121
- key_file: '',
122
- cert_file: '',
123
- secure_protocol: '',
124
- ciphers: ''
125
- },
126
- mongo: {
127
- host: '',
128
- port: 0,
129
- database: '',
130
- username: '',
131
- password: '',
132
- replSet: '',
133
- db_ssl: {
134
- enabled: false,
135
- accept_invalid_cert: false,
136
- ca_file: '',
137
- key_file: '',
138
- cert_file: ''
139
- }
140
- }
141
- }
62
+ properties: samProps
142
63
  }]
143
64
  }
144
65
  };
@@ -7565,5 +7486,2034 @@ describe('[integration] F5BigIQ Adapter Test', () => {
7565
7486
  }
7566
7487
  }).timeout(attemptTimeout);
7567
7488
  });
7489
+
7490
+ describe('#getResolveMachineId - errors', () => {
7491
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
7492
+ try {
7493
+ a.getResolveMachineId(null, (data, error) => {
7494
+ try {
7495
+ if (stub) {
7496
+ const displayE = 'Error 400 received on request';
7497
+ runErrorAsserts(data, error, 'AD.500', 'Test-f5_bigiq-connectorRest-handleEndResponse', displayE);
7498
+ } else {
7499
+ runCommonAsserts(data, error);
7500
+ }
7501
+ saveMockData('BIGIPUUIDLookup', 'getResolveMachineId', 'default', data);
7502
+ done();
7503
+ } catch (err) {
7504
+ log.error(`Test Failure: ${err}`);
7505
+ done(err);
7506
+ }
7507
+ });
7508
+ } catch (error) {
7509
+ log.error(`Adapter Exception: ${error}`);
7510
+ done(error);
7511
+ }
7512
+ }).timeout(attemptTimeout);
7513
+ });
7514
+
7515
+ describe('#getExampleQkview - errors', () => {
7516
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
7517
+ try {
7518
+ a.getExampleQkview((data, error) => {
7519
+ try {
7520
+ if (stub) {
7521
+ const displayE = 'Error 400 received on request';
7522
+ runErrorAsserts(data, error, 'AD.500', 'Test-f5_bigiq-connectorRest-handleEndResponse', displayE);
7523
+ } else {
7524
+ runCommonAsserts(data, error);
7525
+ }
7526
+ saveMockData('Qkview', 'getExampleQkview', 'default', data);
7527
+ done();
7528
+ } catch (err) {
7529
+ log.error(`Test Failure: ${err}`);
7530
+ done(err);
7531
+ }
7532
+ });
7533
+ } catch (error) {
7534
+ log.error(`Adapter Exception: ${error}`);
7535
+ done(error);
7536
+ }
7537
+ }).timeout(attemptTimeout);
7538
+ });
7539
+
7540
+ describe('#retrieveQkviewTasks - errors', () => {
7541
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
7542
+ try {
7543
+ a.retrieveQkviewTasks((data, error) => {
7544
+ try {
7545
+ if (stub) {
7546
+ const displayE = 'Error 400 received on request';
7547
+ runErrorAsserts(data, error, 'AD.500', 'Test-f5_bigiq-connectorRest-handleEndResponse', displayE);
7548
+ } else {
7549
+ runCommonAsserts(data, error);
7550
+ }
7551
+ saveMockData('Qkview', 'retrieveQkviewTasks', 'default', data);
7552
+ done();
7553
+ } catch (err) {
7554
+ log.error(`Test Failure: ${err}`);
7555
+ done(err);
7556
+ }
7557
+ });
7558
+ } catch (error) {
7559
+ log.error(`Adapter Exception: ${error}`);
7560
+ done(error);
7561
+ }
7562
+ }).timeout(attemptTimeout);
7563
+ });
7564
+
7565
+ const qkviewGenerateaQkviewBodyParam = {
7566
+ name: 'test-bigiq-qkview.qkview'
7567
+ };
7568
+ describe('#generateaQkview - errors', () => {
7569
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
7570
+ try {
7571
+ a.generateaQkview(qkviewGenerateaQkviewBodyParam, (data, error) => {
7572
+ try {
7573
+ if (stub) {
7574
+ const displayE = 'Error 400 received on request';
7575
+ runErrorAsserts(data, error, 'AD.500', 'Test-f5_bigiq-connectorRest-handleEndResponse', displayE);
7576
+ } else {
7577
+ runCommonAsserts(data, error);
7578
+ }
7579
+ saveMockData('Qkview', 'generateaQkview', 'default', data);
7580
+ done();
7581
+ } catch (err) {
7582
+ log.error(`Test Failure: ${err}`);
7583
+ done(err);
7584
+ }
7585
+ });
7586
+ } catch (error) {
7587
+ log.error(`Adapter Exception: ${error}`);
7588
+ done(error);
7589
+ }
7590
+ }).timeout(attemptTimeout);
7591
+ });
7592
+
7593
+ describe('#queryBIGIQQkviewTask - errors', () => {
7594
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
7595
+ try {
7596
+ a.queryBIGIQQkviewTask('fakedata', (data, error) => {
7597
+ try {
7598
+ if (stub) {
7599
+ const displayE = 'Error 400 received on request';
7600
+ runErrorAsserts(data, error, 'AD.500', 'Test-f5_bigiq-connectorRest-handleEndResponse', displayE);
7601
+ } else {
7602
+ runCommonAsserts(data, error);
7603
+ }
7604
+ saveMockData('Qkview', 'queryBIGIQQkviewTask', 'default', data);
7605
+ done();
7606
+ } catch (err) {
7607
+ log.error(`Test Failure: ${err}`);
7608
+ done(err);
7609
+ }
7610
+ });
7611
+ } catch (error) {
7612
+ log.error(`Adapter Exception: ${error}`);
7613
+ done(error);
7614
+ }
7615
+ }).timeout(attemptTimeout);
7616
+ });
7617
+
7618
+ describe('#deleteBIGIQQkview - errors', () => {
7619
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
7620
+ try {
7621
+ a.deleteBIGIQQkview('fakedata', (data, error) => {
7622
+ try {
7623
+ if (stub) {
7624
+ const displayE = 'Error 400 received on request';
7625
+ runErrorAsserts(data, error, 'AD.500', 'Test-f5_bigiq-connectorRest-handleEndResponse', displayE);
7626
+ } else {
7627
+ runCommonAsserts(data, error);
7628
+ }
7629
+ saveMockData('Qkview', 'deleteBIGIQQkview', 'default', data);
7630
+ done();
7631
+ } catch (err) {
7632
+ log.error(`Test Failure: ${err}`);
7633
+ done(err);
7634
+ }
7635
+ });
7636
+ } catch (error) {
7637
+ log.error(`Adapter Exception: ${error}`);
7638
+ done(error);
7639
+ }
7640
+ }).timeout(attemptTimeout);
7641
+ });
7642
+
7643
+ describe('#queryBIGIPQkviewTask - errors', () => {
7644
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
7645
+ try {
7646
+ a.queryBIGIPQkviewTask('fakedata', (data, error) => {
7647
+ try {
7648
+ if (stub) {
7649
+ const displayE = 'Error 400 received on request';
7650
+ runErrorAsserts(data, error, 'AD.500', 'Test-f5_bigiq-connectorRest-handleEndResponse', displayE);
7651
+ } else {
7652
+ runCommonAsserts(data, error);
7653
+ }
7654
+ saveMockData('Qkview', 'queryBIGIPQkviewTask', 'default', data);
7655
+ done();
7656
+ } catch (err) {
7657
+ log.error(`Test Failure: ${err}`);
7658
+ done(err);
7659
+ }
7660
+ });
7661
+ } catch (error) {
7662
+ log.error(`Adapter Exception: ${error}`);
7663
+ done(error);
7664
+ }
7665
+ }).timeout(attemptTimeout);
7666
+ });
7667
+
7668
+ describe('#deleteaBIGIPQkview - errors', () => {
7669
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
7670
+ try {
7671
+ a.deleteaBIGIPQkview('fakedata', (data, error) => {
7672
+ try {
7673
+ if (stub) {
7674
+ const displayE = 'Error 400 received on request';
7675
+ runErrorAsserts(data, error, 'AD.500', 'Test-f5_bigiq-connectorRest-handleEndResponse', displayE);
7676
+ } else {
7677
+ runCommonAsserts(data, error);
7678
+ }
7679
+ saveMockData('Qkview', 'deleteaBIGIPQkview', 'default', data);
7680
+ done();
7681
+ } catch (err) {
7682
+ log.error(`Test Failure: ${err}`);
7683
+ done(err);
7684
+ }
7685
+ });
7686
+ } catch (error) {
7687
+ log.error(`Adapter Exception: ${error}`);
7688
+ done(error);
7689
+ }
7690
+ }).timeout(attemptTimeout);
7691
+ });
7692
+
7693
+ describe('#getExampleBIGIPiHealthReport - errors', () => {
7694
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
7695
+ try {
7696
+ a.getExampleBIGIPiHealthReport((data, error) => {
7697
+ try {
7698
+ if (stub) {
7699
+ const displayE = 'Error 400 received on request';
7700
+ runErrorAsserts(data, error, 'AD.500', 'Test-f5_bigiq-connectorRest-handleEndResponse', displayE);
7701
+ } else {
7702
+ runCommonAsserts(data, error);
7703
+ }
7704
+ saveMockData('BIGIPIHealth', 'getExampleBIGIPiHealthReport', 'default', data);
7705
+ done();
7706
+ } catch (err) {
7707
+ log.error(`Test Failure: ${err}`);
7708
+ done(err);
7709
+ }
7710
+ });
7711
+ } catch (error) {
7712
+ log.error(`Adapter Exception: ${error}`);
7713
+ done(error);
7714
+ }
7715
+ }).timeout(attemptTimeout);
7716
+ });
7717
+
7718
+ describe('#getExampleBIGIPiHealthUploads - errors', () => {
7719
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
7720
+ try {
7721
+ a.getExampleBIGIPiHealthUploads((data, error) => {
7722
+ try {
7723
+ if (stub) {
7724
+ const displayE = 'Error 400 received on request';
7725
+ runErrorAsserts(data, error, 'AD.500', 'Test-f5_bigiq-connectorRest-handleEndResponse', displayE);
7726
+ } else {
7727
+ runCommonAsserts(data, error);
7728
+ }
7729
+ saveMockData('BIGIPIHealth', 'getExampleBIGIPiHealthUploads', 'default', data);
7730
+ done();
7731
+ } catch (err) {
7732
+ log.error(`Test Failure: ${err}`);
7733
+ done(err);
7734
+ }
7735
+ });
7736
+ } catch (error) {
7737
+ log.error(`Adapter Exception: ${error}`);
7738
+ done(error);
7739
+ }
7740
+ }).timeout(attemptTimeout);
7741
+ });
7742
+
7743
+ describe('#getExampleBIGIPiHealthCredentials - errors', () => {
7744
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
7745
+ try {
7746
+ a.getExampleBIGIPiHealthCredentials((data, error) => {
7747
+ try {
7748
+ if (stub) {
7749
+ const displayE = 'Error 400 received on request';
7750
+ runErrorAsserts(data, error, 'AD.500', 'Test-f5_bigiq-connectorRest-handleEndResponse', displayE);
7751
+ } else {
7752
+ runCommonAsserts(data, error);
7753
+ }
7754
+ saveMockData('BIGIPIHealth', 'getExampleBIGIPiHealthCredentials', 'default', data);
7755
+ done();
7756
+ } catch (err) {
7757
+ log.error(`Test Failure: ${err}`);
7758
+ done(err);
7759
+ }
7760
+ });
7761
+ } catch (error) {
7762
+ log.error(`Adapter Exception: ${error}`);
7763
+ done(error);
7764
+ }
7765
+ }).timeout(attemptTimeout);
7766
+ });
7767
+
7768
+ describe('#getExampleBIGIPiHealthConfig - errors', () => {
7769
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
7770
+ try {
7771
+ a.getExampleBIGIPiHealthConfig((data, error) => {
7772
+ try {
7773
+ if (stub) {
7774
+ const displayE = 'Error 400 received on request';
7775
+ runErrorAsserts(data, error, 'AD.500', 'Test-f5_bigiq-connectorRest-handleEndResponse', displayE);
7776
+ } else {
7777
+ runCommonAsserts(data, error);
7778
+ }
7779
+ saveMockData('BIGIPIHealth', 'getExampleBIGIPiHealthConfig', 'default', data);
7780
+ done();
7781
+ } catch (err) {
7782
+ log.error(`Test Failure: ${err}`);
7783
+ done(err);
7784
+ }
7785
+ });
7786
+ } catch (error) {
7787
+ log.error(`Adapter Exception: ${error}`);
7788
+ done(error);
7789
+ }
7790
+ }).timeout(attemptTimeout);
7791
+ });
7792
+
7793
+ describe('#retrieveBIGIPiHealthReports - errors', () => {
7794
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
7795
+ try {
7796
+ a.retrieveBIGIPiHealthReports((data, error) => {
7797
+ try {
7798
+ if (stub) {
7799
+ const displayE = 'Error 400 received on request';
7800
+ runErrorAsserts(data, error, 'AD.500', 'Test-f5_bigiq-connectorRest-handleEndResponse', displayE);
7801
+ } else {
7802
+ runCommonAsserts(data, error);
7803
+ }
7804
+ saveMockData('BIGIPIHealth', 'retrieveBIGIPiHealthReports', 'default', data);
7805
+ done();
7806
+ } catch (err) {
7807
+ log.error(`Test Failure: ${err}`);
7808
+ done(err);
7809
+ }
7810
+ });
7811
+ } catch (error) {
7812
+ log.error(`Adapter Exception: ${error}`);
7813
+ done(error);
7814
+ }
7815
+ }).timeout(attemptTimeout);
7816
+ });
7817
+
7818
+ const bIGIPIHealthGenerateBIGIPiHealthReportBodyParam = {
7819
+ name: 'testing-api-uploads',
7820
+ deviceReferences: [
7821
+ {
7822
+ link: ''
7823
+ }
7824
+ ],
7825
+ credentialsReference: {
7826
+ link: ''
7827
+ }
7828
+ };
7829
+ describe('#generateBIGIPiHealthReport - errors', () => {
7830
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
7831
+ try {
7832
+ a.generateBIGIPiHealthReport(bIGIPIHealthGenerateBIGIPiHealthReportBodyParam, (data, error) => {
7833
+ try {
7834
+ if (stub) {
7835
+ const displayE = 'Error 400 received on request';
7836
+ runErrorAsserts(data, error, 'AD.500', 'Test-f5_bigiq-connectorRest-handleEndResponse', displayE);
7837
+ } else {
7838
+ runCommonAsserts(data, error);
7839
+ }
7840
+ saveMockData('BIGIPIHealth', 'generateBIGIPiHealthReport', 'default', data);
7841
+ done();
7842
+ } catch (err) {
7843
+ log.error(`Test Failure: ${err}`);
7844
+ done(err);
7845
+ }
7846
+ });
7847
+ } catch (error) {
7848
+ log.error(`Adapter Exception: ${error}`);
7849
+ done(error);
7850
+ }
7851
+ }).timeout(attemptTimeout);
7852
+ });
7853
+
7854
+ describe('#retrieveBIGIPiHealthCredentials - errors', () => {
7855
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
7856
+ try {
7857
+ a.retrieveBIGIPiHealthCredentials(null, (data, error) => {
7858
+ try {
7859
+ if (stub) {
7860
+ const displayE = 'Error 400 received on request';
7861
+ runErrorAsserts(data, error, 'AD.500', 'Test-f5_bigiq-connectorRest-handleEndResponse', displayE);
7862
+ } else {
7863
+ runCommonAsserts(data, error);
7864
+ }
7865
+ saveMockData('BIGIPIHealth', 'retrieveBIGIPiHealthCredentials', 'default', data);
7866
+ done();
7867
+ } catch (err) {
7868
+ log.error(`Test Failure: ${err}`);
7869
+ done(err);
7870
+ }
7871
+ });
7872
+ } catch (error) {
7873
+ log.error(`Adapter Exception: ${error}`);
7874
+ done(error);
7875
+ }
7876
+ }).timeout(attemptTimeout);
7877
+ });
7878
+
7879
+ const bIGIPIHealthCreateTestBIGIPiHealthCredentialsBodyParam = {
7880
+ displayName: 'ihealth2-testing',
7881
+ description: 'Testing for Itential',
7882
+ username: '',
7883
+ password: ''
7884
+ };
7885
+ describe('#createTestBIGIPiHealthCredentials - errors', () => {
7886
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
7887
+ try {
7888
+ a.createTestBIGIPiHealthCredentials(bIGIPIHealthCreateTestBIGIPiHealthCredentialsBodyParam, (data, error) => {
7889
+ try {
7890
+ if (stub) {
7891
+ const displayE = 'Error 400 received on request';
7892
+ runErrorAsserts(data, error, 'AD.500', 'Test-f5_bigiq-connectorRest-handleEndResponse', displayE);
7893
+ } else {
7894
+ runCommonAsserts(data, error);
7895
+ }
7896
+ saveMockData('BIGIPIHealth', 'createTestBIGIPiHealthCredentials', 'default', data);
7897
+ done();
7898
+ } catch (err) {
7899
+ log.error(`Test Failure: ${err}`);
7900
+ done(err);
7901
+ }
7902
+ });
7903
+ } catch (error) {
7904
+ log.error(`Adapter Exception: ${error}`);
7905
+ done(error);
7906
+ }
7907
+ }).timeout(attemptTimeout);
7908
+ });
7909
+
7910
+ describe('#retrieveBIGIPiHealthConfig - errors', () => {
7911
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
7912
+ try {
7913
+ a.retrieveBIGIPiHealthConfig((data, error) => {
7914
+ try {
7915
+ if (stub) {
7916
+ const displayE = 'Error 400 received on request';
7917
+ runErrorAsserts(data, error, 'AD.500', 'Test-f5_bigiq-connectorRest-handleEndResponse', displayE);
7918
+ } else {
7919
+ runCommonAsserts(data, error);
7920
+ }
7921
+ saveMockData('BIGIPIHealth', 'retrieveBIGIPiHealthConfig', 'default', data);
7922
+ done();
7923
+ } catch (err) {
7924
+ log.error(`Test Failure: ${err}`);
7925
+ done(err);
7926
+ }
7927
+ });
7928
+ } catch (error) {
7929
+ log.error(`Adapter Exception: ${error}`);
7930
+ done(error);
7931
+ }
7932
+ }).timeout(attemptTimeout);
7933
+ });
7934
+
7935
+ const bIGIPIHealthUpdateBIGIPiHealthConfigBodyParam = {
7936
+ concurrentUploadCount: 5,
7937
+ concurrentDownloadCount: 5,
7938
+ iHealthEndpoint: 'https://ihealth-api.f5networks.net/qkview-analyzer/api/',
7939
+ iHealthAuthEndpoint: 'https://identity.account.f5.com/oauth2/ausp95ykc80HOU7SQ357/v1/token'
7940
+ };
7941
+ describe('#updateBIGIPiHealthConfig - errors', () => {
7942
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
7943
+ try {
7944
+ a.updateBIGIPiHealthConfig(bIGIPIHealthUpdateBIGIPiHealthConfigBodyParam, (data, error) => {
7945
+ try {
7946
+ if (stub) {
7947
+ const displayE = 'Error 400 received on request';
7948
+ runErrorAsserts(data, error, 'AD.500', 'Test-f5_bigiq-connectorRest-handleEndResponse', displayE);
7949
+ } else {
7950
+ runCommonAsserts(data, error);
7951
+ }
7952
+ saveMockData('BIGIPIHealth', 'updateBIGIPiHealthConfig', 'default', data);
7953
+ done();
7954
+ } catch (err) {
7955
+ log.error(`Test Failure: ${err}`);
7956
+ done(err);
7957
+ }
7958
+ });
7959
+ } catch (error) {
7960
+ log.error(`Adapter Exception: ${error}`);
7961
+ done(error);
7962
+ }
7963
+ }).timeout(attemptTimeout);
7964
+ });
7965
+
7966
+ describe('#retrieveBIGIPiHealthUploads - errors', () => {
7967
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
7968
+ try {
7969
+ a.retrieveBIGIPiHealthUploads((data, error) => {
7970
+ try {
7971
+ if (stub) {
7972
+ const displayE = 'Error 400 received on request';
7973
+ runErrorAsserts(data, error, 'AD.500', 'Test-f5_bigiq-connectorRest-handleEndResponse', displayE);
7974
+ } else {
7975
+ runCommonAsserts(data, error);
7976
+ }
7977
+ saveMockData('BIGIPIHealth', 'retrieveBIGIPiHealthUploads', 'default', data);
7978
+ done();
7979
+ } catch (err) {
7980
+ log.error(`Test Failure: ${err}`);
7981
+ done(err);
7982
+ }
7983
+ });
7984
+ } catch (error) {
7985
+ log.error(`Adapter Exception: ${error}`);
7986
+ done(error);
7987
+ }
7988
+ }).timeout(attemptTimeout);
7989
+ });
7990
+
7991
+ const bIGIPIHealthCreateBIGIPiHealthUploadTaskBodyParam = {
7992
+ name: 'testing-api-uploads',
7993
+ deviceReferences: [
7994
+ {
7995
+ link: ''
7996
+ }
7997
+ ],
7998
+ credentialsReference: {
7999
+ link: ''
8000
+ }
8001
+ };
8002
+ describe('#createBIGIPiHealthUploadTask - errors', () => {
8003
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
8004
+ try {
8005
+ a.createBIGIPiHealthUploadTask(bIGIPIHealthCreateBIGIPiHealthUploadTaskBodyParam, (data, error) => {
8006
+ try {
8007
+ if (stub) {
8008
+ const displayE = 'Error 400 received on request';
8009
+ runErrorAsserts(data, error, 'AD.500', 'Test-f5_bigiq-connectorRest-handleEndResponse', displayE);
8010
+ } else {
8011
+ runCommonAsserts(data, error);
8012
+ }
8013
+ saveMockData('BIGIPIHealth', 'createBIGIPiHealthUploadTask', 'default', data);
8014
+ done();
8015
+ } catch (err) {
8016
+ log.error(`Test Failure: ${err}`);
8017
+ done(err);
8018
+ }
8019
+ });
8020
+ } catch (error) {
8021
+ log.error(`Adapter Exception: ${error}`);
8022
+ done(error);
8023
+ }
8024
+ }).timeout(attemptTimeout);
8025
+ });
8026
+
8027
+ describe('#queryUploadTaskStatus - errors', () => {
8028
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
8029
+ try {
8030
+ a.queryUploadTaskStatus('fakedata', (data, error) => {
8031
+ try {
8032
+ if (stub) {
8033
+ const displayE = 'Error 400 received on request';
8034
+ runErrorAsserts(data, error, 'AD.500', 'Test-f5_bigiq-connectorRest-handleEndResponse', displayE);
8035
+ } else {
8036
+ runCommonAsserts(data, error);
8037
+ }
8038
+ saveMockData('BIGIPIHealth', 'queryUploadTaskStatus', 'default', data);
8039
+ done();
8040
+ } catch (err) {
8041
+ log.error(`Test Failure: ${err}`);
8042
+ done(err);
8043
+ }
8044
+ });
8045
+ } catch (error) {
8046
+ log.error(`Adapter Exception: ${error}`);
8047
+ done(error);
8048
+ }
8049
+ }).timeout(attemptTimeout);
8050
+ });
8051
+
8052
+ const bIGIPIHealthModifyTestBIGIPiHealthCredentialsBodyParam = {
8053
+ displayName: 'ihealth2-testing',
8054
+ description: 'Testing for Itential',
8055
+ username: '0oas5oa1j8C1vDEyV357',
8056
+ encryptedPassword: 'ttZNs4dlnYnR6afp8yrDuhqJmOCN5yNG3ou6NSJjYuu0o7UC0L93hiBFZc9bA+rUTOaATvZc8CBbj1zkIr4R0Q=='
8057
+ };
8058
+ describe('#modifyTestBIGIPiHealthCredentials - errors', () => {
8059
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
8060
+ try {
8061
+ a.modifyTestBIGIPiHealthCredentials('fakedata', bIGIPIHealthModifyTestBIGIPiHealthCredentialsBodyParam, (data, error) => {
8062
+ try {
8063
+ if (stub) {
8064
+ const displayE = 'Error 400 received on request';
8065
+ runErrorAsserts(data, error, 'AD.500', 'Test-f5_bigiq-connectorRest-handleEndResponse', displayE);
8066
+ } else {
8067
+ runCommonAsserts(data, error);
8068
+ }
8069
+ saveMockData('BIGIPIHealth', 'modifyTestBIGIPiHealthCredentials', 'default', data);
8070
+ done();
8071
+ } catch (err) {
8072
+ log.error(`Test Failure: ${err}`);
8073
+ done(err);
8074
+ }
8075
+ });
8076
+ } catch (error) {
8077
+ log.error(`Adapter Exception: ${error}`);
8078
+ done(error);
8079
+ }
8080
+ }).timeout(attemptTimeout);
8081
+ });
8082
+
8083
+ describe('#deleteTestBIGIPiHealthCredentials - errors', () => {
8084
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
8085
+ try {
8086
+ a.deleteTestBIGIPiHealthCredentials('fakedata', (data, error) => {
8087
+ try {
8088
+ if (stub) {
8089
+ const displayE = 'Error 400 received on request';
8090
+ runErrorAsserts(data, error, 'AD.500', 'Test-f5_bigiq-connectorRest-handleEndResponse', displayE);
8091
+ } else {
8092
+ runCommonAsserts(data, error);
8093
+ }
8094
+ saveMockData('BIGIPIHealth', 'deleteTestBIGIPiHealthCredentials', 'default', data);
8095
+ done();
8096
+ } catch (err) {
8097
+ log.error(`Test Failure: ${err}`);
8098
+ done(err);
8099
+ }
8100
+ });
8101
+ } catch (error) {
8102
+ log.error(`Adapter Exception: ${error}`);
8103
+ done(error);
8104
+ }
8105
+ }).timeout(attemptTimeout);
8106
+ });
8107
+
8108
+ describe('#verifyProperSystemStatus - errors', () => {
8109
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
8110
+ try {
8111
+ a.verifyProperSystemStatus((data, error) => {
8112
+ try {
8113
+ if (stub) {
8114
+ const displayE = 'Error 400 received on request';
8115
+ runErrorAsserts(data, error, 'AD.500', 'Test-f5_bigiq-connectorRest-handleEndResponse', displayE);
8116
+ } else {
8117
+ runCommonAsserts(data, error);
8118
+ }
8119
+ saveMockData('BIGIQSystemClusterStatus', 'verifyProperSystemStatus', 'default', data);
8120
+ done();
8121
+ } catch (err) {
8122
+ log.error(`Test Failure: ${err}`);
8123
+ done(err);
8124
+ }
8125
+ });
8126
+ } catch (error) {
8127
+ log.error(`Adapter Exception: ${error}`);
8128
+ done(error);
8129
+ }
8130
+ }).timeout(attemptTimeout);
8131
+ });
8132
+
8133
+ describe('#verifyProperHAStatus - errors', () => {
8134
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
8135
+ try {
8136
+ a.verifyProperHAStatus((data, error) => {
8137
+ try {
8138
+ if (stub) {
8139
+ const displayE = 'Error 400 received on request';
8140
+ runErrorAsserts(data, error, 'AD.500', 'Test-f5_bigiq-connectorRest-handleEndResponse', displayE);
8141
+ } else {
8142
+ runCommonAsserts(data, error);
8143
+ }
8144
+ saveMockData('BIGIQSystemClusterStatus', 'verifyProperHAStatus', 'default', data);
8145
+ done();
8146
+ } catch (err) {
8147
+ log.error(`Test Failure: ${err}`);
8148
+ done(err);
8149
+ }
8150
+ });
8151
+ } catch (error) {
8152
+ log.error(`Adapter Exception: ${error}`);
8153
+ done(error);
8154
+ }
8155
+ }).timeout(attemptTimeout);
8156
+ });
8157
+
8158
+ describe('#getExampleBackupRestoreTask - errors', () => {
8159
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
8160
+ try {
8161
+ a.getExampleBackupRestoreTask((data, error) => {
8162
+ try {
8163
+ if (stub) {
8164
+ const displayE = 'Error 400 received on request';
8165
+ runErrorAsserts(data, error, 'AD.500', 'Test-f5_bigiq-connectorRest-handleEndResponse', displayE);
8166
+ } else {
8167
+ runCommonAsserts(data, error);
8168
+ }
8169
+ saveMockData('DeviceBackups', 'getExampleBackupRestoreTask', 'default', data);
8170
+ done();
8171
+ } catch (err) {
8172
+ log.error(`Test Failure: ${err}`);
8173
+ done(err);
8174
+ }
8175
+ });
8176
+ } catch (error) {
8177
+ log.error(`Adapter Exception: ${error}`);
8178
+ done(error);
8179
+ }
8180
+ }).timeout(attemptTimeout);
8181
+ });
8182
+
8183
+ describe('#retrieveallBackupTasks - errors', () => {
8184
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
8185
+ try {
8186
+ a.retrieveallBackupTasks((data, error) => {
8187
+ try {
8188
+ if (stub) {
8189
+ const displayE = 'Error 400 received on request';
8190
+ runErrorAsserts(data, error, 'AD.500', 'Test-f5_bigiq-connectorRest-handleEndResponse', displayE);
8191
+ } else {
8192
+ runCommonAsserts(data, error);
8193
+ }
8194
+ saveMockData('DeviceBackups', 'retrieveallBackupTasks', 'default', data);
8195
+ done();
8196
+ } catch (err) {
8197
+ log.error(`Test Failure: ${err}`);
8198
+ done(err);
8199
+ }
8200
+ });
8201
+ } catch (error) {
8202
+ log.error(`Adapter Exception: ${error}`);
8203
+ done(error);
8204
+ }
8205
+ }).timeout(attemptTimeout);
8206
+ });
8207
+
8208
+ const deviceBackupsGenerateBackupofDeviceBodyParam = {
8209
+ name: 'testing3-task.ucs',
8210
+ includePrivateKeys: true,
8211
+ isEncrypted: false,
8212
+ deviceReference: {
8213
+ link: ''
8214
+ },
8215
+ backupLifeTime: 1,
8216
+ description: 'Itential testing'
8217
+ };
8218
+ describe('#generateBackupofDevice - errors', () => {
8219
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
8220
+ try {
8221
+ a.generateBackupofDevice(deviceBackupsGenerateBackupofDeviceBodyParam, (data, error) => {
8222
+ try {
8223
+ if (stub) {
8224
+ const displayE = 'Error 400 received on request';
8225
+ runErrorAsserts(data, error, 'AD.500', 'Test-f5_bigiq-connectorRest-handleEndResponse', displayE);
8226
+ } else {
8227
+ runCommonAsserts(data, error);
8228
+ }
8229
+ saveMockData('DeviceBackups', 'generateBackupofDevice', 'default', data);
8230
+ done();
8231
+ } catch (err) {
8232
+ log.error(`Test Failure: ${err}`);
8233
+ done(err);
8234
+ }
8235
+ });
8236
+ } catch (error) {
8237
+ log.error(`Adapter Exception: ${error}`);
8238
+ done(error);
8239
+ }
8240
+ }).timeout(attemptTimeout);
8241
+ });
8242
+
8243
+ describe('#queryBackupTaskStatus - errors', () => {
8244
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
8245
+ try {
8246
+ a.queryBackupTaskStatus('fakedata', (data, error) => {
8247
+ try {
8248
+ if (stub) {
8249
+ const displayE = 'Error 400 received on request';
8250
+ runErrorAsserts(data, error, 'AD.500', 'Test-f5_bigiq-connectorRest-handleEndResponse', displayE);
8251
+ } else {
8252
+ runCommonAsserts(data, error);
8253
+ }
8254
+ saveMockData('DeviceBackups', 'queryBackupTaskStatus', 'default', data);
8255
+ done();
8256
+ } catch (err) {
8257
+ log.error(`Test Failure: ${err}`);
8258
+ done(err);
8259
+ }
8260
+ });
8261
+ } catch (error) {
8262
+ log.error(`Adapter Exception: ${error}`);
8263
+ done(error);
8264
+ }
8265
+ }).timeout(attemptTimeout);
8266
+ });
8267
+
8268
+ describe('#deleteBackupFile - errors', () => {
8269
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
8270
+ try {
8271
+ a.deleteBackupFile('fakedata', (data, error) => {
8272
+ try {
8273
+ if (stub) {
8274
+ const displayE = 'Error 400 received on request';
8275
+ runErrorAsserts(data, error, 'AD.500', 'Test-f5_bigiq-connectorRest-handleEndResponse', displayE);
8276
+ } else {
8277
+ runCommonAsserts(data, error);
8278
+ }
8279
+ saveMockData('DeviceBackups', 'deleteBackupFile', 'default', data);
8280
+ done();
8281
+ } catch (err) {
8282
+ log.error(`Test Failure: ${err}`);
8283
+ done(err);
8284
+ }
8285
+ });
8286
+ } catch (error) {
8287
+ log.error(`Adapter Exception: ${error}`);
8288
+ done(error);
8289
+ }
8290
+ }).timeout(attemptTimeout);
8291
+ });
8292
+
8293
+ const deviceBackupsGenerateBackupFileDownloadPathHashBodyParam = {
8294
+ path: '/mgmt/cm/system/backup-download/testing3-task.ucs',
8295
+ supportsBlob: true,
8296
+ downloadFilename: 'testing3-task.ucs'
8297
+ };
8298
+ describe('#generateBackupFileDownloadPathHash - errors', () => {
8299
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
8300
+ try {
8301
+ a.generateBackupFileDownloadPathHash(deviceBackupsGenerateBackupFileDownloadPathHashBodyParam, (data, error) => {
8302
+ try {
8303
+ if (stub) {
8304
+ const displayE = 'Error 400 received on request';
8305
+ runErrorAsserts(data, error, 'AD.500', 'Test-f5_bigiq-connectorRest-handleEndResponse', displayE);
8306
+ } else {
8307
+ runCommonAsserts(data, error);
8308
+ }
8309
+ saveMockData('DeviceBackups', 'generateBackupFileDownloadPathHash', 'default', data);
8310
+ done();
8311
+ } catch (err) {
8312
+ log.error(`Test Failure: ${err}`);
8313
+ done(err);
8314
+ }
8315
+ });
8316
+ } catch (error) {
8317
+ log.error(`Adapter Exception: ${error}`);
8318
+ done(error);
8319
+ }
8320
+ }).timeout(attemptTimeout);
8321
+ });
8322
+
8323
+ describe('#downloadBackupFileusingPathHash - errors', () => {
8324
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
8325
+ try {
8326
+ a.downloadBackupFileusingPathHash('fakedata', (data, error) => {
8327
+ try {
8328
+ if (stub) {
8329
+ const displayE = 'Error 400 received on request';
8330
+ runErrorAsserts(data, error, 'AD.500', 'Test-f5_bigiq-connectorRest-handleEndResponse', displayE);
8331
+ } else {
8332
+ runCommonAsserts(data, error);
8333
+ }
8334
+ saveMockData('DeviceBackups', 'downloadBackupFileusingPathHash', 'default', data);
8335
+ done();
8336
+ } catch (err) {
8337
+ log.error(`Test Failure: ${err}`);
8338
+ done(err);
8339
+ }
8340
+ });
8341
+ } catch (error) {
8342
+ log.error(`Adapter Exception: ${error}`);
8343
+ done(error);
8344
+ }
8345
+ }).timeout(attemptTimeout);
8346
+ });
8347
+
8348
+ describe('#getExampleBIGIPscripts - errors', () => {
8349
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
8350
+ try {
8351
+ a.getExampleBIGIPscripts((data, error) => {
8352
+ try {
8353
+ if (stub) {
8354
+ const displayE = 'Error 400 received on request';
8355
+ runErrorAsserts(data, error, 'AD.500', 'Test-f5_bigiq-connectorRest-handleEndResponse', displayE);
8356
+ } else {
8357
+ runCommonAsserts(data, error);
8358
+ }
8359
+ saveMockData('BIGIPTMSHScripting', 'getExampleBIGIPscripts', 'default', data);
8360
+ done();
8361
+ } catch (err) {
8362
+ log.error(`Test Failure: ${err}`);
8363
+ done(err);
8364
+ }
8365
+ });
8366
+ } catch (error) {
8367
+ log.error(`Adapter Exception: ${error}`);
8368
+ done(error);
8369
+ }
8370
+ }).timeout(attemptTimeout);
8371
+ });
8372
+
8373
+ describe('#retrieveallBIGIPscripts - errors', () => {
8374
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
8375
+ try {
8376
+ a.retrieveallBIGIPscripts((data, error) => {
8377
+ try {
8378
+ if (stub) {
8379
+ const displayE = 'Error 400 received on request';
8380
+ runErrorAsserts(data, error, 'AD.500', 'Test-f5_bigiq-connectorRest-handleEndResponse', displayE);
8381
+ } else {
8382
+ runCommonAsserts(data, error);
8383
+ }
8384
+ saveMockData('BIGIPTMSHScripting', 'retrieveallBIGIPscripts', 'default', data);
8385
+ done();
8386
+ } catch (err) {
8387
+ log.error(`Test Failure: ${err}`);
8388
+ done(err);
8389
+ }
8390
+ });
8391
+ } catch (error) {
8392
+ log.error(`Adapter Exception: ${error}`);
8393
+ done(error);
8394
+ }
8395
+ }).timeout(attemptTimeout);
8396
+ });
8397
+
8398
+ const bIGIPTMSHScriptingCreateaBIGIPscriptBodyParam = {
8399
+ name: 'check service check date',
8400
+ description: 'returns the service check date from the license',
8401
+ script: 'tmsh show sys license | grep \'Service Check Date\''
8402
+ };
8403
+ describe('#createaBIGIPscript - errors', () => {
8404
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
8405
+ try {
8406
+ a.createaBIGIPscript(bIGIPTMSHScriptingCreateaBIGIPscriptBodyParam, (data, error) => {
8407
+ try {
8408
+ if (stub) {
8409
+ const displayE = 'Error 400 received on request';
8410
+ runErrorAsserts(data, error, 'AD.500', 'Test-f5_bigiq-connectorRest-handleEndResponse', displayE);
8411
+ } else {
8412
+ runCommonAsserts(data, error);
8413
+ }
8414
+ saveMockData('BIGIPTMSHScripting', 'createaBIGIPscript', 'default', data);
8415
+ done();
8416
+ } catch (err) {
8417
+ log.error(`Test Failure: ${err}`);
8418
+ done(err);
8419
+ }
8420
+ });
8421
+ } catch (error) {
8422
+ log.error(`Adapter Exception: ${error}`);
8423
+ done(error);
8424
+ }
8425
+ }).timeout(attemptTimeout);
8426
+ });
8427
+
8428
+ const bIGIPTMSHScriptingExecuteaBIGIPscriptBodyParam = {
8429
+ name: 'check service check date',
8430
+ deviceReferences: [
8431
+ {
8432
+ link: ''
8433
+ }
8434
+ ],
8435
+ timeout: 30,
8436
+ scriptReference: {
8437
+ link: ''
8438
+ }
8439
+ };
8440
+ describe('#executeaBIGIPscript - errors', () => {
8441
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
8442
+ try {
8443
+ a.executeaBIGIPscript(bIGIPTMSHScriptingExecuteaBIGIPscriptBodyParam, (data, error) => {
8444
+ try {
8445
+ if (stub) {
8446
+ const displayE = 'Error 400 received on request';
8447
+ runErrorAsserts(data, error, 'AD.500', 'Test-f5_bigiq-connectorRest-handleEndResponse', displayE);
8448
+ } else {
8449
+ runCommonAsserts(data, error);
8450
+ }
8451
+ saveMockData('BIGIPTMSHScripting', 'executeaBIGIPscript', 'default', data);
8452
+ done();
8453
+ } catch (err) {
8454
+ log.error(`Test Failure: ${err}`);
8455
+ done(err);
8456
+ }
8457
+ });
8458
+ } catch (error) {
8459
+ log.error(`Adapter Exception: ${error}`);
8460
+ done(error);
8461
+ }
8462
+ }).timeout(attemptTimeout);
8463
+ });
8464
+
8465
+ describe('#queryBIGIPscriptstatus - errors', () => {
8466
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
8467
+ try {
8468
+ a.queryBIGIPscriptstatus('fakedata', (data, error) => {
8469
+ try {
8470
+ if (stub) {
8471
+ const displayE = 'Error 400 received on request';
8472
+ runErrorAsserts(data, error, 'AD.500', 'Test-f5_bigiq-connectorRest-handleEndResponse', displayE);
8473
+ } else {
8474
+ runCommonAsserts(data, error);
8475
+ }
8476
+ saveMockData('BIGIPTMSHScripting', 'queryBIGIPscriptstatus', 'default', data);
8477
+ done();
8478
+ } catch (err) {
8479
+ log.error(`Test Failure: ${err}`);
8480
+ done(err);
8481
+ }
8482
+ });
8483
+ } catch (error) {
8484
+ log.error(`Adapter Exception: ${error}`);
8485
+ done(error);
8486
+ }
8487
+ }).timeout(attemptTimeout);
8488
+ });
8489
+
8490
+ describe('#retrieveallSoftwareImages - errors', () => {
8491
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
8492
+ try {
8493
+ a.retrieveallSoftwareImages(null, null, (data, error) => {
8494
+ try {
8495
+ if (stub) {
8496
+ const displayE = 'Error 400 received on request';
8497
+ runErrorAsserts(data, error, 'AD.500', 'Test-f5_bigiq-connectorRest-handleEndResponse', displayE);
8498
+ } else {
8499
+ runCommonAsserts(data, error);
8500
+ }
8501
+ saveMockData('BIGIPSoftwareImageManagement', 'retrieveallSoftwareImages', 'default', data);
8502
+ done();
8503
+ } catch (err) {
8504
+ log.error(`Test Failure: ${err}`);
8505
+ done(err);
8506
+ }
8507
+ });
8508
+ } catch (error) {
8509
+ log.error(`Adapter Exception: ${error}`);
8510
+ done(error);
8511
+ }
8512
+ }).timeout(attemptTimeout);
8513
+ });
8514
+
8515
+ describe('#retrieveallBIGIPsandimageslots - errors', () => {
8516
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
8517
+ try {
8518
+ a.retrieveallBIGIPsandimageslots(null, (data, error) => {
8519
+ try {
8520
+ if (stub) {
8521
+ const displayE = 'Error 400 received on request';
8522
+ runErrorAsserts(data, error, 'AD.500', 'Test-f5_bigiq-connectorRest-handleEndResponse', displayE);
8523
+ } else {
8524
+ runCommonAsserts(data, error);
8525
+ }
8526
+ saveMockData('BIGIPSoftwareImageManagement', 'retrieveallBIGIPsandimageslots', 'default', data);
8527
+ done();
8528
+ } catch (err) {
8529
+ log.error(`Test Failure: ${err}`);
8530
+ done(err);
8531
+ }
8532
+ });
8533
+ } catch (error) {
8534
+ log.error(`Adapter Exception: ${error}`);
8535
+ done(error);
8536
+ }
8537
+ }).timeout(attemptTimeout);
8538
+ });
8539
+
8540
+ describe('#retrievaallUpgradeTasks - errors', () => {
8541
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
8542
+ try {
8543
+ a.retrievaallUpgradeTasks((data, error) => {
8544
+ try {
8545
+ if (stub) {
8546
+ const displayE = 'Error 400 received on request';
8547
+ runErrorAsserts(data, error, 'AD.500', 'Test-f5_bigiq-connectorRest-handleEndResponse', displayE);
8548
+ } else {
8549
+ runCommonAsserts(data, error);
8550
+ }
8551
+ saveMockData('DeviceUpgrades', 'retrievaallUpgradeTasks', 'default', data);
8552
+ done();
8553
+ } catch (err) {
8554
+ log.error(`Test Failure: ${err}`);
8555
+ done(err);
8556
+ }
8557
+ });
8558
+ } catch (error) {
8559
+ log.error(`Adapter Exception: ${error}`);
8560
+ done(error);
8561
+ }
8562
+ }).timeout(attemptTimeout);
8563
+ });
8564
+
8565
+ const deviceUpgradesPerformSoftwareUpgradeBodyParam = {
8566
+ name: 'mybackuptask',
8567
+ softwareImageReference: {
8568
+ link: 'https://localhost/mgmt/cm/autodeploy/software-images/BIGIP-16.1.2.1-0.0.11.iso'
8569
+ },
8570
+ stopBeforeInstall: true,
8571
+ stopBeforeReboot: true,
8572
+ stopForBackups: true,
8573
+ serialMode: true,
8574
+ stopForAssessments: true,
8575
+ selectByDevice: true,
8576
+ deviceInput: [
8577
+ {
8578
+ deviceReference: {
8579
+ link: 'https://localhost/mgmt/shared/resolver/device-groups/cm-bigip-allBigIpDevices/devices/ba7382a4-7564-4647-b65d-17d6f2a73a16'
8580
+ },
8581
+ targetVolume: 'HD1.2',
8582
+ active: 'HD1.1'
8583
+ }
8584
+ ],
8585
+ stopToReview: true
8586
+ };
8587
+ describe('#performSoftwareUpgrade - errors', () => {
8588
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
8589
+ try {
8590
+ a.performSoftwareUpgrade(deviceUpgradesPerformSoftwareUpgradeBodyParam, (data, error) => {
8591
+ try {
8592
+ if (stub) {
8593
+ const displayE = 'Error 400 received on request';
8594
+ runErrorAsserts(data, error, 'AD.500', 'Test-f5_bigiq-connectorRest-handleEndResponse', displayE);
8595
+ } else {
8596
+ runCommonAsserts(data, error);
8597
+ }
8598
+ saveMockData('DeviceUpgrades', 'performSoftwareUpgrade', 'default', data);
8599
+ done();
8600
+ } catch (err) {
8601
+ log.error(`Test Failure: ${err}`);
8602
+ done(err);
8603
+ }
8604
+ });
8605
+ } catch (error) {
8606
+ log.error(`Adapter Exception: ${error}`);
8607
+ done(error);
8608
+ }
8609
+ }).timeout(attemptTimeout);
8610
+ });
8611
+
8612
+ describe('#retrieveBIGIPdevices - errors', () => {
8613
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
8614
+ try {
8615
+ a.retrieveBIGIPdevices(null, null, (data, error) => {
8616
+ try {
8617
+ if (stub) {
8618
+ const displayE = 'Error 400 received on request';
8619
+ runErrorAsserts(data, error, 'AD.500', 'Test-f5_bigiq-connectorRest-handleEndResponse', displayE);
8620
+ } else {
8621
+ runCommonAsserts(data, error);
8622
+ }
8623
+ saveMockData('Device', 'retrieveBIGIPdevices', 'default', data);
8624
+ done();
8625
+ } catch (err) {
8626
+ log.error(`Test Failure: ${err}`);
8627
+ done(err);
8628
+ }
8629
+ });
8630
+ } catch (error) {
8631
+ log.error(`Adapter Exception: ${error}`);
8632
+ done(error);
8633
+ }
8634
+ }).timeout(attemptTimeout);
8635
+ });
8636
+
8637
+ describe('#retrieveDeviceGroups - errors', () => {
8638
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
8639
+ try {
8640
+ a.retrieveDeviceGroups(null, null, null, (data, error) => {
8641
+ try {
8642
+ if (stub) {
8643
+ const displayE = 'Error 400 received on request';
8644
+ runErrorAsserts(data, error, 'AD.500', 'Test-f5_bigiq-connectorRest-handleEndResponse', displayE);
8645
+ } else {
8646
+ runCommonAsserts(data, error);
8647
+ }
8648
+ saveMockData('Device', 'retrieveDeviceGroups', 'default', data);
8649
+ done();
8650
+ } catch (err) {
8651
+ log.error(`Test Failure: ${err}`);
8652
+ done(err);
8653
+ }
8654
+ });
8655
+ } catch (error) {
8656
+ log.error(`Adapter Exception: ${error}`);
8657
+ done(error);
8658
+ }
8659
+ }).timeout(attemptTimeout);
8660
+ });
8661
+
8662
+ describe('#retrieveBIGIPHealthSummary - errors', () => {
8663
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
8664
+ try {
8665
+ a.retrieveBIGIPHealthSummary('fakedata', (data, error) => {
8666
+ try {
8667
+ if (stub) {
8668
+ const displayE = 'Error 400 received on request';
8669
+ runErrorAsserts(data, error, 'AD.500', 'Test-f5_bigiq-connectorRest-handleEndResponse', displayE);
8670
+ } else {
8671
+ runCommonAsserts(data, error);
8672
+ }
8673
+ saveMockData('Device', 'retrieveBIGIPHealthSummary', 'default', data);
8674
+ done();
8675
+ } catch (err) {
8676
+ log.error(`Test Failure: ${err}`);
8677
+ done(err);
8678
+ }
8679
+ });
8680
+ } catch (error) {
8681
+ log.error(`Adapter Exception: ${error}`);
8682
+ done(error);
8683
+ }
8684
+ }).timeout(attemptTimeout);
8685
+ });
8686
+
8687
+ describe('#retrieveBIGIPDeviceImportTasks - errors', () => {
8688
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
8689
+ try {
8690
+ a.retrieveBIGIPDeviceImportTasks(null, (data, error) => {
8691
+ try {
8692
+ if (stub) {
8693
+ const displayE = 'Error 400 received on request';
8694
+ runErrorAsserts(data, error, 'AD.500', 'Test-f5_bigiq-connectorRest-handleEndResponse', displayE);
8695
+ } else {
8696
+ runCommonAsserts(data, error);
8697
+ }
8698
+ saveMockData('DeviceImport', 'retrieveBIGIPDeviceImportTasks', 'default', data);
8699
+ done();
8700
+ } catch (err) {
8701
+ log.error(`Test Failure: ${err}`);
8702
+ done(err);
8703
+ }
8704
+ });
8705
+ } catch (error) {
8706
+ log.error(`Adapter Exception: ${error}`);
8707
+ done(error);
8708
+ }
8709
+ }).timeout(attemptTimeout);
8710
+ });
8711
+
8712
+ const deviceImportPerformBIGIPDeviceImportusingmachineIdBodyParam = {
8713
+ name: 'rediscover_adc_core',
8714
+ conflictPolicy: 'USE_BIGIQ',
8715
+ deviceReference: {
8716
+ link: 'https://localhost/mgmt/cm/system/machineid-resolver/'
8717
+ },
8718
+ failImportOnConflict: true,
8719
+ moduleList: [
8720
+ {
8721
+ module: 'adc_core'
8722
+ }
8723
+ ],
8724
+ status: 'STARTED'
8725
+ };
8726
+ describe('#performBIGIPDeviceImportusingmachineId - errors', () => {
8727
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
8728
+ try {
8729
+ a.performBIGIPDeviceImportusingmachineId(deviceImportPerformBIGIPDeviceImportusingmachineIdBodyParam, (data, error) => {
8730
+ try {
8731
+ if (stub) {
8732
+ const displayE = 'Error 400 received on request';
8733
+ runErrorAsserts(data, error, 'AD.500', 'Test-f5_bigiq-connectorRest-handleEndResponse', displayE);
8734
+ } else {
8735
+ runCommonAsserts(data, error);
8736
+ }
8737
+ saveMockData('DeviceImport', 'performBIGIPDeviceImportusingmachineId', 'default', data);
8738
+ done();
8739
+ } catch (err) {
8740
+ log.error(`Test Failure: ${err}`);
8741
+ done(err);
8742
+ }
8743
+ });
8744
+ } catch (error) {
8745
+ log.error(`Adapter Exception: ${error}`);
8746
+ done(error);
8747
+ }
8748
+ }).timeout(attemptTimeout);
8749
+ });
8750
+
8751
+ const deviceImportPerformBIGIPDeviceImportusingImportTaskBodyParam = {
8752
+ moduleList: [
8753
+ {
8754
+ module: 'firewall'
8755
+ },
8756
+ {
8757
+ module: 'security_shared'
8758
+ },
8759
+ {
8760
+ module: 'adc_core'
8761
+ }
8762
+ ],
8763
+ failOnConflict: true,
8764
+ status: 'STARTED'
8765
+ };
8766
+ describe('#performBIGIPDeviceImportusingImportTask - errors', () => {
8767
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
8768
+ try {
8769
+ a.performBIGIPDeviceImportusingImportTask('fakedata', deviceImportPerformBIGIPDeviceImportusingImportTaskBodyParam, (data, error) => {
8770
+ try {
8771
+ if (stub) {
8772
+ const displayE = 'Error 400 received on request';
8773
+ runErrorAsserts(data, error, 'AD.500', 'Test-f5_bigiq-connectorRest-handleEndResponse', displayE);
8774
+ } else {
8775
+ runCommonAsserts(data, error);
8776
+ }
8777
+ saveMockData('DeviceImport', 'performBIGIPDeviceImportusingImportTask', 'default', data);
8778
+ done();
8779
+ } catch (err) {
8780
+ log.error(`Test Failure: ${err}`);
8781
+ done(err);
8782
+ }
8783
+ });
8784
+ } catch (error) {
8785
+ log.error(`Adapter Exception: ${error}`);
8786
+ done(error);
8787
+ }
8788
+ }).timeout(attemptTimeout);
8789
+ });
8790
+
8791
+ describe('#monitorImportTask - errors', () => {
8792
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
8793
+ try {
8794
+ a.monitorImportTask('fakedata', (data, error) => {
8795
+ try {
8796
+ if (stub) {
8797
+ const displayE = 'Error 400 received on request';
8798
+ runErrorAsserts(data, error, 'AD.500', 'Test-f5_bigiq-connectorRest-handleEndResponse', displayE);
8799
+ } else {
8800
+ runCommonAsserts(data, error);
8801
+ }
8802
+ saveMockData('DeviceImport', 'monitorImportTask', 'default', data);
8803
+ done();
8804
+ } catch (err) {
8805
+ log.error(`Test Failure: ${err}`);
8806
+ done(err);
8807
+ }
8808
+ });
8809
+ } catch (error) {
8810
+ log.error(`Adapter Exception: ${error}`);
8811
+ done(error);
8812
+ }
8813
+ }).timeout(attemptTimeout);
8814
+ });
8815
+
8816
+ describe('#queryDevicebyDeviceReference - errors', () => {
8817
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
8818
+ try {
8819
+ a.queryDevicebyDeviceReference('fakedata', (data, error) => {
8820
+ try {
8821
+ if (stub) {
8822
+ const displayE = 'Error 400 received on request';
8823
+ runErrorAsserts(data, error, 'AD.500', 'Test-f5_bigiq-connectorRest-handleEndResponse', displayE);
8824
+ } else {
8825
+ runCommonAsserts(data, error);
8826
+ }
8827
+ saveMockData('BIGIPDeviceReferenceLookup', 'queryDevicebyDeviceReference', 'default', data);
8828
+ done();
8829
+ } catch (err) {
8830
+ log.error(`Test Failure: ${err}`);
8831
+ done(err);
8832
+ }
8833
+ });
8834
+ } catch (error) {
8835
+ log.error(`Adapter Exception: ${error}`);
8836
+ done(error);
8837
+ }
8838
+ }).timeout(attemptTimeout);
8839
+ });
8840
+
8841
+ describe('#queryDSCGroup - errors', () => {
8842
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
8843
+ try {
8844
+ a.queryDSCGroup(null, (data, error) => {
8845
+ try {
8846
+ if (stub) {
8847
+ const displayE = 'Error 400 received on request';
8848
+ runErrorAsserts(data, error, 'AD.500', 'Test-f5_bigiq-connectorRest-handleEndResponse', displayE);
8849
+ } else {
8850
+ runCommonAsserts(data, error);
8851
+ }
8852
+ saveMockData('BIGIPDeviceClustering', 'queryDSCGroup', 'default', data);
8853
+ done();
8854
+ } catch (err) {
8855
+ log.error(`Test Failure: ${err}`);
8856
+ done(err);
8857
+ }
8858
+ });
8859
+ } catch (error) {
8860
+ log.error(`Adapter Exception: ${error}`);
8861
+ done(error);
8862
+ }
8863
+ }).timeout(attemptTimeout);
8864
+ });
8865
+
8866
+ describe('#queryDSCGroupByGroupId - errors', () => {
8867
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
8868
+ try {
8869
+ a.queryDSCGroupByGroupId('fakedata', (data, error) => {
8870
+ try {
8871
+ if (stub) {
8872
+ const displayE = 'Error 400 received on request';
8873
+ runErrorAsserts(data, error, 'AD.500', 'Test-f5_bigiq-connectorRest-handleEndResponse', displayE);
8874
+ } else {
8875
+ runCommonAsserts(data, error);
8876
+ }
8877
+ saveMockData('BIGIPDeviceClustering', 'queryDSCGroupByGroupId', 'default', data);
8878
+ done();
8879
+ } catch (err) {
8880
+ log.error(`Test Failure: ${err}`);
8881
+ done(err);
8882
+ }
8883
+ });
8884
+ } catch (error) {
8885
+ log.error(`Adapter Exception: ${error}`);
8886
+ done(error);
8887
+ }
8888
+ }).timeout(attemptTimeout);
8889
+ });
8890
+
8891
+ describe('#retrieveLicenseInformation - errors', () => {
8892
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
8893
+ try {
8894
+ a.retrieveLicenseInformation((data, error) => {
8895
+ try {
8896
+ if (stub) {
8897
+ const displayE = 'Error 400 received on request';
8898
+ runErrorAsserts(data, error, 'AD.500', 'Test-f5_bigiq-connectorRest-handleEndResponse', displayE);
8899
+ } else {
8900
+ runCommonAsserts(data, error);
8901
+ }
8902
+ saveMockData('Licensing', 'retrieveLicenseInformation', 'default', data);
8903
+ done();
8904
+ } catch (err) {
8905
+ log.error(`Test Failure: ${err}`);
8906
+ done(err);
8907
+ }
8908
+ });
8909
+ } catch (error) {
8910
+ log.error(`Adapter Exception: ${error}`);
8911
+ done(error);
8912
+ }
8913
+ }).timeout(attemptTimeout);
8914
+ });
8915
+
8916
+ const licensingActivateReactiveLicenseBodyParam = {};
8917
+ describe('#activateReactiveLicense - errors', () => {
8918
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
8919
+ try {
8920
+ a.activateReactiveLicense(licensingActivateReactiveLicenseBodyParam, (data, error) => {
8921
+ try {
8922
+ if (stub) {
8923
+ const displayE = 'Error 400 received on request';
8924
+ runErrorAsserts(data, error, 'AD.500', 'Test-f5_bigiq-connectorRest-handleEndResponse', displayE);
8925
+ } else {
8926
+ runCommonAsserts(data, error);
8927
+ }
8928
+ saveMockData('Licensing', 'activateReactiveLicense', 'default', data);
8929
+ done();
8930
+ } catch (err) {
8931
+ log.error(`Test Failure: ${err}`);
8932
+ done(err);
8933
+ }
8934
+ });
8935
+ } catch (error) {
8936
+ log.error(`Adapter Exception: ${error}`);
8937
+ done(error);
8938
+ }
8939
+ }).timeout(attemptTimeout);
8940
+ });
8941
+
8942
+ describe('#showBIGIPLicenseExample - errors', () => {
8943
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
8944
+ try {
8945
+ a.showBIGIPLicenseExample((data, error) => {
8946
+ try {
8947
+ if (stub) {
8948
+ const displayE = 'Error 400 received on request';
8949
+ runErrorAsserts(data, error, 'AD.500', 'Test-f5_bigiq-connectorRest-handleEndResponse', displayE);
8950
+ } else {
8951
+ runCommonAsserts(data, error);
8952
+ }
8953
+ saveMockData('Licensing', 'showBIGIPLicenseExample', 'default', data);
8954
+ done();
8955
+ } catch (err) {
8956
+ log.error(`Test Failure: ${err}`);
8957
+ done(err);
8958
+ }
8959
+ });
8960
+ } catch (error) {
8961
+ log.error(`Adapter Exception: ${error}`);
8962
+ done(error);
8963
+ }
8964
+ }).timeout(attemptTimeout);
8965
+ });
8966
+
8967
+ describe('#retrievesoftwareprovisioningFeatures - errors', () => {
8968
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
8969
+ try {
8970
+ a.retrievesoftwareprovisioningFeatures((data, error) => {
8971
+ try {
8972
+ if (stub) {
8973
+ const displayE = 'Error 400 received on request';
8974
+ runErrorAsserts(data, error, 'AD.500', 'Test-f5_bigiq-connectorRest-handleEndResponse', displayE);
8975
+ } else {
8976
+ runCommonAsserts(data, error);
8977
+ }
8978
+ saveMockData('DeviceInfo', 'retrievesoftwareprovisioningFeatures', 'default', data);
8979
+ done();
8980
+ } catch (err) {
8981
+ log.error(`Test Failure: ${err}`);
8982
+ done(err);
8983
+ }
8984
+ });
8985
+ } catch (error) {
8986
+ log.error(`Adapter Exception: ${error}`);
8987
+ done(error);
8988
+ }
8989
+ }).timeout(attemptTimeout);
8990
+ });
8991
+
8992
+ const deviceInfoRunCommandAsRootUserBodyParam = {
8993
+ command: 'run',
8994
+ utilCmdArgs: '-c \'f5mku -K\''
8995
+ };
8996
+ describe('#runCommandAsRootUser - errors', () => {
8997
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
8998
+ try {
8999
+ a.runCommandAsRootUser(deviceInfoRunCommandAsRootUserBodyParam, (data, error) => {
9000
+ try {
9001
+ if (stub) {
9002
+ const displayE = 'Error 400 received on request';
9003
+ runErrorAsserts(data, error, 'AD.500', 'Test-f5_bigiq-connectorRest-handleEndResponse', displayE);
9004
+ } else {
9005
+ runCommonAsserts(data, error);
9006
+ }
9007
+ saveMockData('DeviceInfo', 'runCommandAsRootUser', 'default', data);
9008
+ done();
9009
+ } catch (err) {
9010
+ log.error(`Test Failure: ${err}`);
9011
+ done(err);
9012
+ }
9013
+ });
9014
+ } catch (error) {
9015
+ log.error(`Adapter Exception: ${error}`);
9016
+ done(error);
9017
+ }
9018
+ }).timeout(attemptTimeout);
9019
+ });
9020
+
9021
+ describe('#retrieveallsoftwareimages - errors', () => {
9022
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
9023
+ try {
9024
+ a.retrieveallsoftwareimages((data, error) => {
9025
+ try {
9026
+ if (stub) {
9027
+ const displayE = 'Error 400 received on request';
9028
+ runErrorAsserts(data, error, 'AD.500', 'Test-f5_bigiq-connectorRest-handleEndResponse', displayE);
9029
+ } else {
9030
+ runCommonAsserts(data, error);
9031
+ }
9032
+ saveMockData('SoftwareManagement', 'retrieveallsoftwareimages', 'default', data);
9033
+ done();
9034
+ } catch (err) {
9035
+ log.error(`Test Failure: ${err}`);
9036
+ done(err);
9037
+ }
9038
+ });
9039
+ } catch (error) {
9040
+ log.error(`Adapter Exception: ${error}`);
9041
+ done(error);
9042
+ }
9043
+ }).timeout(attemptTimeout);
9044
+ });
9045
+
9046
+ describe('#retrieveallhotfiximages - errors', () => {
9047
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
9048
+ try {
9049
+ a.retrieveallhotfiximages((data, error) => {
9050
+ try {
9051
+ if (stub) {
9052
+ const displayE = 'Error 400 received on request';
9053
+ runErrorAsserts(data, error, 'AD.500', 'Test-f5_bigiq-connectorRest-handleEndResponse', displayE);
9054
+ } else {
9055
+ runCommonAsserts(data, error);
9056
+ }
9057
+ saveMockData('SoftwareManagement', 'retrieveallhotfiximages', 'default', data);
9058
+ done();
9059
+ } catch (err) {
9060
+ log.error(`Test Failure: ${err}`);
9061
+ done(err);
9062
+ }
9063
+ });
9064
+ } catch (error) {
9065
+ log.error(`Adapter Exception: ${error}`);
9066
+ done(error);
9067
+ }
9068
+ }).timeout(attemptTimeout);
9069
+ });
9070
+
9071
+ describe('#retrieveallLTMcertificateobjects - errors', () => {
9072
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
9073
+ try {
9074
+ a.retrieveallLTMcertificateobjects((data, error) => {
9075
+ try {
9076
+ if (stub) {
9077
+ const displayE = 'Error 400 received on request';
9078
+ runErrorAsserts(data, error, 'AD.500', 'Test-f5_bigiq-connectorRest-handleEndResponse', displayE);
9079
+ } else {
9080
+ runCommonAsserts(data, error);
9081
+ }
9082
+ saveMockData('SSLManagement', 'retrieveallLTMcertificateobjects', 'default', data);
9083
+ done();
9084
+ } catch (err) {
9085
+ log.error(`Test Failure: ${err}`);
9086
+ done(err);
9087
+ }
9088
+ });
9089
+ } catch (error) {
9090
+ log.error(`Adapter Exception: ${error}`);
9091
+ done(error);
9092
+ }
9093
+ }).timeout(attemptTimeout);
9094
+ });
9095
+
9096
+ const sSLManagementCreateOverwriteSSLCertificatefromUploadBodyParam = {
9097
+ command: 'install',
9098
+ name: 'mysslcertificate',
9099
+ 'from-local-file': '/var/config/rest/downloads/mysslcertificate.crt'
9100
+ };
9101
+ describe('#createOverwriteSSLCertificatefromUpload - errors', () => {
9102
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
9103
+ try {
9104
+ a.createOverwriteSSLCertificatefromUpload(sSLManagementCreateOverwriteSSLCertificatefromUploadBodyParam, (data, error) => {
9105
+ try {
9106
+ if (stub) {
9107
+ const displayE = 'Error 400 received on request';
9108
+ runErrorAsserts(data, error, 'AD.500', 'Test-f5_bigiq-connectorRest-handleEndResponse', displayE);
9109
+ } else {
9110
+ runCommonAsserts(data, error);
9111
+ }
9112
+ saveMockData('SSLManagement', 'createOverwriteSSLCertificatefromUpload', 'default', data);
9113
+ done();
9114
+ } catch (err) {
9115
+ log.error(`Test Failure: ${err}`);
9116
+ done(err);
9117
+ }
9118
+ });
9119
+ } catch (error) {
9120
+ log.error(`Adapter Exception: ${error}`);
9121
+ done(error);
9122
+ }
9123
+ }).timeout(attemptTimeout);
9124
+ });
9125
+
9126
+ describe('#retrieveallLTMprivatekeyobjects - errors', () => {
9127
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
9128
+ try {
9129
+ a.retrieveallLTMprivatekeyobjects((data, error) => {
9130
+ try {
9131
+ if (stub) {
9132
+ const displayE = 'Error 400 received on request';
9133
+ runErrorAsserts(data, error, 'AD.500', 'Test-f5_bigiq-connectorRest-handleEndResponse', displayE);
9134
+ } else {
9135
+ runCommonAsserts(data, error);
9136
+ }
9137
+ saveMockData('SSLManagement', 'retrieveallLTMprivatekeyobjects', 'default', data);
9138
+ done();
9139
+ } catch (err) {
9140
+ log.error(`Test Failure: ${err}`);
9141
+ done(err);
9142
+ }
9143
+ });
9144
+ } catch (error) {
9145
+ log.error(`Adapter Exception: ${error}`);
9146
+ done(error);
9147
+ }
9148
+ }).timeout(attemptTimeout);
9149
+ });
9150
+
9151
+ const sSLManagementCreateOverwriteSSLKeyfromUploadBodyParam = {
9152
+ command: 'install',
9153
+ name: 'mysslcertificate',
9154
+ 'from-local-file': '/var/config/rest/downloads/mysslcertificate.key'
9155
+ };
9156
+ describe('#createOverwriteSSLKeyfromUpload - errors', () => {
9157
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
9158
+ try {
9159
+ a.createOverwriteSSLKeyfromUpload(sSLManagementCreateOverwriteSSLKeyfromUploadBodyParam, (data, error) => {
9160
+ try {
9161
+ if (stub) {
9162
+ const displayE = 'Error 400 received on request';
9163
+ runErrorAsserts(data, error, 'AD.500', 'Test-f5_bigiq-connectorRest-handleEndResponse', displayE);
9164
+ } else {
9165
+ runCommonAsserts(data, error);
9166
+ }
9167
+ saveMockData('SSLManagement', 'createOverwriteSSLKeyfromUpload', 'default', data);
9168
+ done();
9169
+ } catch (err) {
9170
+ log.error(`Test Failure: ${err}`);
9171
+ done(err);
9172
+ }
9173
+ });
9174
+ } catch (error) {
9175
+ log.error(`Adapter Exception: ${error}`);
9176
+ done(error);
9177
+ }
9178
+ }).timeout(attemptTimeout);
9179
+ });
9180
+
9181
+ describe('#retrieveallcertificatefiles - errors', () => {
9182
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
9183
+ try {
9184
+ a.retrieveallcertificatefiles((data, error) => {
9185
+ try {
9186
+ if (stub) {
9187
+ const displayE = 'Error 400 received on request';
9188
+ runErrorAsserts(data, error, 'AD.500', 'Test-f5_bigiq-connectorRest-handleEndResponse', displayE);
9189
+ } else {
9190
+ runCommonAsserts(data, error);
9191
+ }
9192
+ saveMockData('SSLManagement', 'retrieveallcertificatefiles', 'default', data);
9193
+ done();
9194
+ } catch (err) {
9195
+ log.error(`Test Failure: ${err}`);
9196
+ done(err);
9197
+ }
9198
+ });
9199
+ } catch (error) {
9200
+ log.error(`Adapter Exception: ${error}`);
9201
+ done(error);
9202
+ }
9203
+ }).timeout(attemptTimeout);
9204
+ });
9205
+
9206
+ describe('#retrieveallkeyfiles - errors', () => {
9207
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
9208
+ try {
9209
+ a.retrieveallkeyfiles((data, error) => {
9210
+ try {
9211
+ if (stub) {
9212
+ const displayE = 'Error 400 received on request';
9213
+ runErrorAsserts(data, error, 'AD.500', 'Test-f5_bigiq-connectorRest-handleEndResponse', displayE);
9214
+ } else {
9215
+ runCommonAsserts(data, error);
9216
+ }
9217
+ saveMockData('SSLManagement', 'retrieveallkeyfiles', 'default', data);
9218
+ done();
9219
+ } catch (err) {
9220
+ log.error(`Test Failure: ${err}`);
9221
+ done(err);
9222
+ }
9223
+ });
9224
+ } catch (error) {
9225
+ log.error(`Adapter Exception: ${error}`);
9226
+ done(error);
9227
+ }
9228
+ }).timeout(attemptTimeout);
9229
+ });
9230
+
9231
+ describe('#retrieveallclientSSLprofiles - errors', () => {
9232
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
9233
+ try {
9234
+ a.retrieveallclientSSLprofiles((data, error) => {
9235
+ try {
9236
+ if (stub) {
9237
+ const displayE = 'Error 400 received on request';
9238
+ runErrorAsserts(data, error, 'AD.500', 'Test-f5_bigiq-connectorRest-handleEndResponse', displayE);
9239
+ } else {
9240
+ runCommonAsserts(data, error);
9241
+ }
9242
+ saveMockData('SSLManagement', 'retrieveallclientSSLprofiles', 'default', data);
9243
+ done();
9244
+ } catch (err) {
9245
+ log.error(`Test Failure: ${err}`);
9246
+ done(err);
9247
+ }
9248
+ });
9249
+ } catch (error) {
9250
+ log.error(`Adapter Exception: ${error}`);
9251
+ done(error);
9252
+ }
9253
+ }).timeout(attemptTimeout);
9254
+ });
9255
+
9256
+ const sSLManagementCreateClientSSLProfileBodyParam = {
9257
+ name: 'myclientsslprofile',
9258
+ defaultsFrom: '/Common/clientssl',
9259
+ cert: '/Common/mysslcertificate',
9260
+ key: '/Common/mysslcertificate',
9261
+ usage: 'Server'
9262
+ };
9263
+ describe('#createClientSSLProfile - errors', () => {
9264
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
9265
+ try {
9266
+ a.createClientSSLProfile(sSLManagementCreateClientSSLProfileBodyParam, (data, error) => {
9267
+ try {
9268
+ if (stub) {
9269
+ const displayE = 'Error 400 received on request';
9270
+ runErrorAsserts(data, error, 'AD.500', 'Test-f5_bigiq-connectorRest-handleEndResponse', displayE);
9271
+ } else {
9272
+ runCommonAsserts(data, error);
9273
+ }
9274
+ saveMockData('SSLManagement', 'createClientSSLProfile', 'default', data);
9275
+ done();
9276
+ } catch (err) {
9277
+ log.error(`Test Failure: ${err}`);
9278
+ done(err);
9279
+ }
9280
+ });
9281
+ } catch (error) {
9282
+ log.error(`Adapter Exception: ${error}`);
9283
+ done(error);
9284
+ }
9285
+ }).timeout(attemptTimeout);
9286
+ });
9287
+
9288
+ describe('#getClientSSLProfileAPIExample - errors', () => {
9289
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
9290
+ try {
9291
+ a.getClientSSLProfileAPIExample((data, error) => {
9292
+ try {
9293
+ if (stub) {
9294
+ const displayE = 'Error 400 received on request';
9295
+ runErrorAsserts(data, error, 'AD.500', 'Test-f5_bigiq-connectorRest-handleEndResponse', displayE);
9296
+ } else {
9297
+ runCommonAsserts(data, error);
9298
+ }
9299
+ saveMockData('SSLManagement', 'getClientSSLProfileAPIExample', 'default', data);
9300
+ done();
9301
+ } catch (err) {
9302
+ log.error(`Test Failure: ${err}`);
9303
+ done(err);
9304
+ }
9305
+ });
9306
+ } catch (error) {
9307
+ log.error(`Adapter Exception: ${error}`);
9308
+ done(error);
9309
+ }
9310
+ }).timeout(attemptTimeout);
9311
+ });
9312
+
9313
+ describe('#uploadSSLCertificate - errors', () => {
9314
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
9315
+ try {
9316
+ a.uploadSSLCertificate('fakedata', (data, error) => {
9317
+ try {
9318
+ if (stub) {
9319
+ const displayE = 'Error 400 received on request';
9320
+ runErrorAsserts(data, error, 'AD.500', 'Test-f5_bigiq-connectorRest-handleEndResponse', displayE);
9321
+ } else {
9322
+ runCommonAsserts(data, error);
9323
+ }
9324
+ saveMockData('SSLManagement', 'uploadSSLCertificate', 'default', data);
9325
+ done();
9326
+ } catch (err) {
9327
+ log.error(`Test Failure: ${err}`);
9328
+ done(err);
9329
+ }
9330
+ });
9331
+ } catch (error) {
9332
+ log.error(`Adapter Exception: ${error}`);
9333
+ done(error);
9334
+ }
9335
+ }).timeout(attemptTimeout);
9336
+ });
9337
+
9338
+ describe('#uploadSSLKey - errors', () => {
9339
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
9340
+ try {
9341
+ a.uploadSSLKey('fakedata', (data, error) => {
9342
+ try {
9343
+ if (stub) {
9344
+ const displayE = 'Error 400 received on request';
9345
+ runErrorAsserts(data, error, 'AD.500', 'Test-f5_bigiq-connectorRest-handleEndResponse', displayE);
9346
+ } else {
9347
+ runCommonAsserts(data, error);
9348
+ }
9349
+ saveMockData('SSLManagement', 'uploadSSLKey', 'default', data);
9350
+ done();
9351
+ } catch (err) {
9352
+ log.error(`Test Failure: ${err}`);
9353
+ done(err);
9354
+ }
9355
+ });
9356
+ } catch (error) {
9357
+ log.error(`Adapter Exception: ${error}`);
9358
+ done(error);
9359
+ }
9360
+ }).timeout(attemptTimeout);
9361
+ });
9362
+
9363
+ const sSLManagementAttachClientSSLProfiletoVirtualServerBodyParam = {
9364
+ name: 'myclientsslprofile'
9365
+ };
9366
+ describe('#attachClientSSLProfiletoVirtualServer - errors', () => {
9367
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
9368
+ try {
9369
+ a.attachClientSSLProfiletoVirtualServer(sSLManagementAttachClientSSLProfiletoVirtualServerBodyParam, (data, error) => {
9370
+ try {
9371
+ if (stub) {
9372
+ const displayE = 'Error 400 received on request';
9373
+ runErrorAsserts(data, error, 'AD.500', 'Test-f5_bigiq-connectorRest-handleEndResponse', displayE);
9374
+ } else {
9375
+ runCommonAsserts(data, error);
9376
+ }
9377
+ saveMockData('SSLManagement', 'attachClientSSLProfiletoVirtualServer', 'default', data);
9378
+ done();
9379
+ } catch (err) {
9380
+ log.error(`Test Failure: ${err}`);
9381
+ done(err);
9382
+ }
9383
+ });
9384
+ } catch (error) {
9385
+ log.error(`Adapter Exception: ${error}`);
9386
+ done(error);
9387
+ }
9388
+ }).timeout(attemptTimeout);
9389
+ });
9390
+
9391
+ describe('#detachClientSSLProfilefromVirtualServer - errors', () => {
9392
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
9393
+ try {
9394
+ a.detachClientSSLProfilefromVirtualServer((data, error) => {
9395
+ try {
9396
+ if (stub) {
9397
+ const displayE = 'Error 400 received on request';
9398
+ runErrorAsserts(data, error, 'AD.500', 'Test-f5_bigiq-connectorRest-handleEndResponse', displayE);
9399
+ } else {
9400
+ runCommonAsserts(data, error);
9401
+ }
9402
+ saveMockData('SSLManagement', 'detachClientSSLProfilefromVirtualServer', 'default', data);
9403
+ done();
9404
+ } catch (err) {
9405
+ log.error(`Test Failure: ${err}`);
9406
+ done(err);
9407
+ }
9408
+ });
9409
+ } catch (error) {
9410
+ log.error(`Adapter Exception: ${error}`);
9411
+ done(error);
9412
+ }
9413
+ }).timeout(attemptTimeout);
9414
+ });
9415
+
9416
+ describe('#deleteClientSSLProfile - errors', () => {
9417
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
9418
+ try {
9419
+ a.deleteClientSSLProfile((data, error) => {
9420
+ try {
9421
+ if (stub) {
9422
+ const displayE = 'Error 400 received on request';
9423
+ runErrorAsserts(data, error, 'AD.500', 'Test-f5_bigiq-connectorRest-handleEndResponse', displayE);
9424
+ } else {
9425
+ runCommonAsserts(data, error);
9426
+ }
9427
+ saveMockData('SSLManagement', 'deleteClientSSLProfile', 'default', data);
9428
+ done();
9429
+ } catch (err) {
9430
+ log.error(`Test Failure: ${err}`);
9431
+ done(err);
9432
+ }
9433
+ });
9434
+ } catch (error) {
9435
+ log.error(`Adapter Exception: ${error}`);
9436
+ done(error);
9437
+ }
9438
+ }).timeout(attemptTimeout);
9439
+ });
9440
+
9441
+ describe('#deleteSSLCertificate - errors', () => {
9442
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
9443
+ try {
9444
+ a.deleteSSLCertificate((data, error) => {
9445
+ try {
9446
+ if (stub) {
9447
+ const displayE = 'Error 400 received on request';
9448
+ runErrorAsserts(data, error, 'AD.500', 'Test-f5_bigiq-connectorRest-handleEndResponse', displayE);
9449
+ } else {
9450
+ runCommonAsserts(data, error);
9451
+ }
9452
+ saveMockData('SSLManagement', 'deleteSSLCertificate', 'default', data);
9453
+ done();
9454
+ } catch (err) {
9455
+ log.error(`Test Failure: ${err}`);
9456
+ done(err);
9457
+ }
9458
+ });
9459
+ } catch (error) {
9460
+ log.error(`Adapter Exception: ${error}`);
9461
+ done(error);
9462
+ }
9463
+ }).timeout(attemptTimeout);
9464
+ });
9465
+
9466
+ describe('#deleteCryptoSSLKey - errors', () => {
9467
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
9468
+ try {
9469
+ a.deleteCryptoSSLKey((data, error) => {
9470
+ try {
9471
+ if (stub) {
9472
+ const displayE = 'Error 400 received on request';
9473
+ runErrorAsserts(data, error, 'AD.500', 'Test-f5_bigiq-connectorRest-handleEndResponse', displayE);
9474
+ } else {
9475
+ runCommonAsserts(data, error);
9476
+ }
9477
+ saveMockData('SSLManagement', 'deleteCryptoSSLKey', 'default', data);
9478
+ done();
9479
+ } catch (err) {
9480
+ log.error(`Test Failure: ${err}`);
9481
+ done(err);
9482
+ }
9483
+ });
9484
+ } catch (error) {
9485
+ log.error(`Adapter Exception: ${error}`);
9486
+ done(error);
9487
+ }
9488
+ }).timeout(attemptTimeout);
9489
+ });
9490
+
9491
+ const configurationSaveConfigurationBodyParam = {
9492
+ command: 'save'
9493
+ };
9494
+ describe('#saveConfiguration - errors', () => {
9495
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
9496
+ try {
9497
+ a.saveConfiguration(configurationSaveConfigurationBodyParam, (data, error) => {
9498
+ try {
9499
+ if (stub) {
9500
+ const displayE = 'Error 400 received on request';
9501
+ runErrorAsserts(data, error, 'AD.500', 'Test-f5_bigiq-connectorRest-handleEndResponse', displayE);
9502
+ } else {
9503
+ runCommonAsserts(data, error);
9504
+ }
9505
+ saveMockData('Configuration', 'saveConfiguration', 'default', data);
9506
+ done();
9507
+ } catch (err) {
9508
+ log.error(`Test Failure: ${err}`);
9509
+ done(err);
9510
+ }
9511
+ });
9512
+ } catch (error) {
9513
+ log.error(`Adapter Exception: ${error}`);
9514
+ done(error);
9515
+ }
9516
+ }).timeout(attemptTimeout);
9517
+ });
7568
9518
  });
7569
9519
  });