@itentialopensource/adapter-paragon_pathfinder 1.2.6 → 1.2.8

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.
@@ -7310,5 +7310,458 @@ describe('[integration] Paragon_pathfinder Adapter Test', () => {
7310
7310
  }
7311
7311
  }).timeout(attemptTimeout);
7312
7312
  });
7313
+
7314
+ describe('#getTopologyV2TopologyIdIpePolicy - errors', () => {
7315
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
7316
+ try {
7317
+ a.getTopologyV2TopologyIdIpePolicy(555, (data, error) => {
7318
+ try {
7319
+ if (stub) {
7320
+ const displayE = 'Error 400 received on request';
7321
+ runErrorAsserts(data, error, 'AD.500', 'Test-paragon_pathfinder-connectorRest-handleEndResponse', displayE);
7322
+ } else {
7323
+ runCommonAsserts(data, error);
7324
+ }
7325
+ saveMockData('Topology', 'getTopologyV2TopologyIdIpePolicy', 'default', data);
7326
+ done();
7327
+ } catch (err) {
7328
+ log.error(`Test Failure: ${err}`);
7329
+ done(err);
7330
+ }
7331
+ });
7332
+ } catch (error) {
7333
+ log.error(`Adapter Exception: ${error}`);
7334
+ done(error);
7335
+ }
7336
+ }).timeout(attemptTimeout);
7337
+ });
7338
+
7339
+ const topologyPostTopologyV2TopologyIdIpePolicyBodyParam = [
7340
+ {}
7341
+ ];
7342
+ describe('#postTopologyV2TopologyIdIpePolicy - errors', () => {
7343
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
7344
+ try {
7345
+ a.postTopologyV2TopologyIdIpePolicy(555, topologyPostTopologyV2TopologyIdIpePolicyBodyParam, (data, error) => {
7346
+ try {
7347
+ if (stub) {
7348
+ const displayE = 'Error 400 received on request';
7349
+ runErrorAsserts(data, error, 'AD.500', 'Test-paragon_pathfinder-connectorRest-handleEndResponse', displayE);
7350
+ } else {
7351
+ runCommonAsserts(data, error);
7352
+ }
7353
+ saveMockData('Topology', 'postTopologyV2TopologyIdIpePolicy', 'default', data);
7354
+ done();
7355
+ } catch (err) {
7356
+ log.error(`Test Failure: ${err}`);
7357
+ done(err);
7358
+ }
7359
+ });
7360
+ } catch (error) {
7361
+ log.error(`Adapter Exception: ${error}`);
7362
+ done(error);
7363
+ }
7364
+ }).timeout(attemptTimeout);
7365
+ });
7366
+
7367
+ const topologyPutTopologyV2TopologyIdIpePolicyBodyParam = [
7368
+ {
7369
+ asPath: {
7370
+ regex: 'string'
7371
+ },
7372
+ id: 9,
7373
+ med: 6,
7374
+ neighbor: null,
7375
+ node: {
7376
+ AutonomousSystem: {
7377
+ asNumber: null
7378
+ },
7379
+ activeAssurance: {
7380
+ agentPath: 'string'
7381
+ },
7382
+ comment: 'string',
7383
+ configurationDataSource: {
7384
+ latest: {
7385
+ href: 'string',
7386
+ rel: 'string',
7387
+ schema: null,
7388
+ type: 'string'
7389
+ }
7390
+ },
7391
+ design: {
7392
+ delay: 7,
7393
+ simulation: {
7394
+ canFail: true
7395
+ },
7396
+ trafficRerouteThreshold: 4,
7397
+ userCost: 1
7398
+ },
7399
+ deviceUuid: 'string',
7400
+ epeProperties: {
7401
+ bandwidth: 4,
7402
+ externalRates: [
7403
+ null,
7404
+ null,
7405
+ null,
7406
+ null
7407
+ ],
7408
+ internalRate: 6,
7409
+ peeringRatePlan: [
7410
+ {
7411
+ bound: 9,
7412
+ rate: 8
7413
+ }
7414
+ ]
7415
+ },
7416
+ extraIpAddresses: [
7417
+ null
7418
+ ],
7419
+ hostName: 'string',
7420
+ id: 'string',
7421
+ layer: 'string',
7422
+ live: false,
7423
+ logicalSystemParent: 'string',
7424
+ name: 'string',
7425
+ nodeIndex: 5,
7426
+ nodeType: 'string',
7427
+ prefixes: [
7428
+ {
7429
+ SR: {
7430
+ algo: 3,
7431
+ flags: 4,
7432
+ index: 1
7433
+ },
7434
+ SRv6: {
7435
+ algo: 1,
7436
+ flags: 2,
7437
+ metric: 3
7438
+ },
7439
+ role: 'string'
7440
+ },
7441
+ {
7442
+ SR: {
7443
+ algo: 2,
7444
+ flags: 10,
7445
+ index: 9
7446
+ },
7447
+ SRv6: {
7448
+ algo: 3,
7449
+ flags: 2,
7450
+ metric: 5
7451
+ },
7452
+ role: 'string'
7453
+ },
7454
+ {
7455
+ SR: {
7456
+ algo: 10,
7457
+ flags: 6,
7458
+ index: 3
7459
+ },
7460
+ SRv6: {
7461
+ algo: 7,
7462
+ flags: 10,
7463
+ metric: 9
7464
+ },
7465
+ role: 'string'
7466
+ },
7467
+ {
7468
+ SR: {
7469
+ algo: 6,
7470
+ flags: 1,
7471
+ index: 8
7472
+ },
7473
+ SRv6: {
7474
+ algo: 3,
7475
+ flags: 3,
7476
+ metric: 6
7477
+ },
7478
+ role: 'string'
7479
+ },
7480
+ {
7481
+ SR: {
7482
+ algo: 5,
7483
+ flags: 1,
7484
+ index: 7
7485
+ },
7486
+ SRv6: {
7487
+ algo: 5,
7488
+ flags: 4,
7489
+ metric: 9
7490
+ },
7491
+ role: 'string'
7492
+ },
7493
+ {
7494
+ SR: {
7495
+ algo: 6,
7496
+ flags: 10,
7497
+ index: 9
7498
+ },
7499
+ SRv6: {
7500
+ algo: 9,
7501
+ flags: 3,
7502
+ metric: 3
7503
+ },
7504
+ role: 'string'
7505
+ }
7506
+ ],
7507
+ protocols: {
7508
+ BGP: {
7509
+ AutonomousSystem: {
7510
+ asNumber: null
7511
+ },
7512
+ id: 'string'
7513
+ },
7514
+ ISIS: {
7515
+ TERouterId: 'string',
7516
+ TERouterIdIPv6: 'string',
7517
+ area: 'string',
7518
+ isoAddress: 'string',
7519
+ overloadBit: true,
7520
+ routerId: 'string',
7521
+ routerIdIPv6: 'string'
7522
+ },
7523
+ NETCONF: {
7524
+ clientAddress: null,
7525
+ clientCapabilities: [
7526
+ 'string',
7527
+ 'string',
7528
+ 'string',
7529
+ 'string',
7530
+ 'string',
7531
+ 'string',
7532
+ 'string',
7533
+ 'string'
7534
+ ],
7535
+ operationalState: 'Invalid_credentials',
7536
+ operationalStatus: 'Up',
7537
+ sessionParameters: {
7538
+ keepalive: 10
7539
+ }
7540
+ },
7541
+ OSPF: {
7542
+ TERouterId: 'string',
7543
+ TERouterIdIPv6: 'string',
7544
+ overloadBit: true,
7545
+ referenceBw: 1,
7546
+ routerId: 'string',
7547
+ routerIdIPv6: 'string'
7548
+ },
7549
+ PCEP: {
7550
+ extensions: {
7551
+ 'lsp-association-protection': true
7552
+ },
7553
+ operationalStatus: 'Empty',
7554
+ pccAddress: null,
7555
+ peerStatefullCapabilities: {
7556
+ SRCapability: false,
7557
+ SRv6Capability: true,
7558
+ lspInstantiation: false,
7559
+ lspUpdate: true,
7560
+ p2mp: true,
7561
+ p2mpInstantiation: false,
7562
+ p2mpUpdate: false
7563
+ },
7564
+ sessionParameters: {
7565
+ deadtimer: 7,
7566
+ keepalive: 8,
7567
+ maximumStackDepth: 5
7568
+ }
7569
+ },
7570
+ SR: {
7571
+ SRGBs: [
7572
+ {
7573
+ range: 10,
7574
+ start: 6
7575
+ },
7576
+ {
7577
+ range: 2,
7578
+ start: 8
7579
+ },
7580
+ {
7581
+ range: 8,
7582
+ start: 1
7583
+ }
7584
+ ],
7585
+ capabilities: {
7586
+ unrestrictedFirstHop: true
7587
+ },
7588
+ enabled: false,
7589
+ nodeCapabilities: 10
7590
+ },
7591
+ SRv6: {
7592
+ enabled: false,
7593
+ msdType: {
7594
+ baseMplsImposition: 4,
7595
+ erld: 10,
7596
+ srhMaxEndD: 9,
7597
+ srhMaxEndPop: 6,
7598
+ srhMaxHEncaps: 9,
7599
+ srhMaxLs: 2
7600
+ },
7601
+ nodeCapabilities: 3
7602
+ },
7603
+ management: {
7604
+ address: null,
7605
+ operatingSystem: 'string',
7606
+ operatingSystemVersion: 'string',
7607
+ vendor: 'string'
7608
+ }
7609
+ },
7610
+ pseudoNode: true,
7611
+ routerId: 'string',
7612
+ routerIdIPv6: 'string',
7613
+ site: 'string',
7614
+ slices: [
7615
+ {
7616
+ sliceId: 7
7617
+ },
7618
+ {
7619
+ sliceId: 5
7620
+ },
7621
+ {
7622
+ sliceId: 5
7623
+ },
7624
+ {
7625
+ sliceId: 4
7626
+ },
7627
+ {
7628
+ sliceId: 8
7629
+ },
7630
+ {
7631
+ sliceId: 4
7632
+ },
7633
+ {
7634
+ sliceId: 7
7635
+ },
7636
+ {
7637
+ sliceId: 1
7638
+ },
7639
+ {
7640
+ sliceId: 4
7641
+ }
7642
+ ],
7643
+ switchingCapabilities: [
7644
+ {
7645
+ encoding: 'lsp-encoding-oduk',
7646
+ switchingCapability: 'switching-l2sc'
7647
+ },
7648
+ {
7649
+ encoding: 'lsp-encoding-lambda',
7650
+ switchingCapability: 'switching-tdm'
7651
+ },
7652
+ {
7653
+ encoding: 'lsp-encoding-line',
7654
+ switchingCapability: 'switching-psc1'
7655
+ },
7656
+ {
7657
+ encoding: 'lsp-encoding-digital-wrapper',
7658
+ switchingCapability: 'switching-packet'
7659
+ },
7660
+ {
7661
+ encoding: 'lsp-encoding-pdh',
7662
+ switchingCapability: 'switching-evpl'
7663
+ },
7664
+ {
7665
+ encoding: 'lsp-encoding-pdh',
7666
+ switchingCapability: 'switching-evpl'
7667
+ }
7668
+ ],
7669
+ topoObjectType: 'node',
7670
+ topology: {
7671
+ coordinates: {
7672
+ bbox: [
7673
+ 5,
7674
+ 9,
7675
+ 6,
7676
+ 6,
7677
+ 1
7678
+ ],
7679
+ crs: {
7680
+ properties: {},
7681
+ type: 'string'
7682
+ }
7683
+ }
7684
+ },
7685
+ topologyIndex: 1,
7686
+ userProperties: {}
7687
+ },
7688
+ prefix: null,
7689
+ priority: 7
7690
+ }
7691
+ ];
7692
+ describe('#putTopologyV2TopologyIdIpePolicy - errors', () => {
7693
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
7694
+ try {
7695
+ a.putTopologyV2TopologyIdIpePolicy(555, topologyPutTopologyV2TopologyIdIpePolicyBodyParam, (data, error) => {
7696
+ try {
7697
+ if (stub) {
7698
+ const displayE = 'Error 400 received on request';
7699
+ runErrorAsserts(data, error, 'AD.500', 'Test-paragon_pathfinder-connectorRest-handleEndResponse', displayE);
7700
+ } else {
7701
+ runCommonAsserts(data, error);
7702
+ }
7703
+ saveMockData('Topology', 'putTopologyV2TopologyIdIpePolicy', 'default', data);
7704
+ done();
7705
+ } catch (err) {
7706
+ log.error(`Test Failure: ${err}`);
7707
+ done(err);
7708
+ }
7709
+ });
7710
+ } catch (error) {
7711
+ log.error(`Adapter Exception: ${error}`);
7712
+ done(error);
7713
+ }
7714
+ }).timeout(attemptTimeout);
7715
+ });
7716
+
7717
+ describe('#deleteTopologyV2TopologyIdIpePolicy - errors', () => {
7718
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
7719
+ try {
7720
+ a.deleteTopologyV2TopologyIdIpePolicy(555, (data, error) => {
7721
+ try {
7722
+ if (stub) {
7723
+ const displayE = 'Error 400 received on request';
7724
+ runErrorAsserts(data, error, 'AD.500', 'Test-paragon_pathfinder-connectorRest-handleEndResponse', displayE);
7725
+ } else {
7726
+ runCommonAsserts(data, error);
7727
+ }
7728
+ saveMockData('Topology', 'deleteTopologyV2TopologyIdIpePolicy', 'default', data);
7729
+ done();
7730
+ } catch (err) {
7731
+ log.error(`Test Failure: ${err}`);
7732
+ done(err);
7733
+ }
7734
+ });
7735
+ } catch (error) {
7736
+ log.error(`Adapter Exception: ${error}`);
7737
+ done(error);
7738
+ }
7739
+ }).timeout(attemptTimeout);
7740
+ });
7741
+
7742
+ describe('#getTopologyV2TopologyIdIpePolicyIpePolicyId - errors', () => {
7743
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
7744
+ try {
7745
+ a.getTopologyV2TopologyIdIpePolicyIpePolicyId(555, 555, (data, error) => {
7746
+ try {
7747
+ if (stub) {
7748
+ const displayE = 'Error 400 received on request';
7749
+ runErrorAsserts(data, error, 'AD.500', 'Test-paragon_pathfinder-connectorRest-handleEndResponse', displayE);
7750
+ } else {
7751
+ runCommonAsserts(data, error);
7752
+ }
7753
+ saveMockData('Topology', 'getTopologyV2TopologyIdIpePolicyIpePolicyId', 'default', data);
7754
+ done();
7755
+ } catch (err) {
7756
+ log.error(`Test Failure: ${err}`);
7757
+ done(err);
7758
+ }
7759
+ });
7760
+ } catch (error) {
7761
+ log.error(`Adapter Exception: ${error}`);
7762
+ done(error);
7763
+ }
7764
+ }).timeout(attemptTimeout);
7765
+ });
7313
7766
  });
7314
7767
  });
@@ -5995,5 +5995,167 @@ describe('[unit] Paragon_pathfinder Adapter Test', () => {
5995
5995
  }
5996
5996
  }).timeout(attemptTimeout);
5997
5997
  });
5998
+
5999
+ describe('#getTopologyV2TopologyIdIpePolicy - errors', () => {
6000
+ it('should have a getTopologyV2TopologyIdIpePolicy function', (done) => {
6001
+ try {
6002
+ assert.equal(true, typeof a.getTopologyV2TopologyIdIpePolicy === 'function');
6003
+ done();
6004
+ } catch (error) {
6005
+ log.error(`Test Failure: ${error}`);
6006
+ done(error);
6007
+ }
6008
+ }).timeout(attemptTimeout);
6009
+ it('should error if - missing topologyId', (done) => {
6010
+ try {
6011
+ a.getTopologyV2TopologyIdIpePolicy(null, (data, error) => {
6012
+ try {
6013
+ const displayE = 'topologyId is required';
6014
+ runErrorAsserts(data, error, 'AD.300', 'Test-paragon_pathfinder-adapter-getTopologyV2TopologyIdIpePolicy', displayE);
6015
+ done();
6016
+ } catch (err) {
6017
+ log.error(`Test Failure: ${err}`);
6018
+ done(err);
6019
+ }
6020
+ });
6021
+ } catch (error) {
6022
+ log.error(`Adapter Exception: ${error}`);
6023
+ done(error);
6024
+ }
6025
+ }).timeout(attemptTimeout);
6026
+ });
6027
+
6028
+ describe('#postTopologyV2TopologyIdIpePolicy - errors', () => {
6029
+ it('should have a postTopologyV2TopologyIdIpePolicy function', (done) => {
6030
+ try {
6031
+ assert.equal(true, typeof a.postTopologyV2TopologyIdIpePolicy === 'function');
6032
+ done();
6033
+ } catch (error) {
6034
+ log.error(`Test Failure: ${error}`);
6035
+ done(error);
6036
+ }
6037
+ }).timeout(attemptTimeout);
6038
+ it('should error if - missing topologyId', (done) => {
6039
+ try {
6040
+ a.postTopologyV2TopologyIdIpePolicy(null, null, (data, error) => {
6041
+ try {
6042
+ const displayE = 'topologyId is required';
6043
+ runErrorAsserts(data, error, 'AD.300', 'Test-paragon_pathfinder-adapter-postTopologyV2TopologyIdIpePolicy', displayE);
6044
+ done();
6045
+ } catch (err) {
6046
+ log.error(`Test Failure: ${err}`);
6047
+ done(err);
6048
+ }
6049
+ });
6050
+ } catch (error) {
6051
+ log.error(`Adapter Exception: ${error}`);
6052
+ done(error);
6053
+ }
6054
+ }).timeout(attemptTimeout);
6055
+ });
6056
+
6057
+ describe('#putTopologyV2TopologyIdIpePolicy - errors', () => {
6058
+ it('should have a putTopologyV2TopologyIdIpePolicy function', (done) => {
6059
+ try {
6060
+ assert.equal(true, typeof a.putTopologyV2TopologyIdIpePolicy === 'function');
6061
+ done();
6062
+ } catch (error) {
6063
+ log.error(`Test Failure: ${error}`);
6064
+ done(error);
6065
+ }
6066
+ }).timeout(attemptTimeout);
6067
+ it('should error if - missing topologyId', (done) => {
6068
+ try {
6069
+ a.putTopologyV2TopologyIdIpePolicy(null, null, (data, error) => {
6070
+ try {
6071
+ const displayE = 'topologyId is required';
6072
+ runErrorAsserts(data, error, 'AD.300', 'Test-paragon_pathfinder-adapter-putTopologyV2TopologyIdIpePolicy', displayE);
6073
+ done();
6074
+ } catch (err) {
6075
+ log.error(`Test Failure: ${err}`);
6076
+ done(err);
6077
+ }
6078
+ });
6079
+ } catch (error) {
6080
+ log.error(`Adapter Exception: ${error}`);
6081
+ done(error);
6082
+ }
6083
+ }).timeout(attemptTimeout);
6084
+ });
6085
+
6086
+ describe('#deleteTopologyV2TopologyIdIpePolicy - errors', () => {
6087
+ it('should have a deleteTopologyV2TopologyIdIpePolicy function', (done) => {
6088
+ try {
6089
+ assert.equal(true, typeof a.deleteTopologyV2TopologyIdIpePolicy === 'function');
6090
+ done();
6091
+ } catch (error) {
6092
+ log.error(`Test Failure: ${error}`);
6093
+ done(error);
6094
+ }
6095
+ }).timeout(attemptTimeout);
6096
+ it('should error if - missing topologyId', (done) => {
6097
+ try {
6098
+ a.deleteTopologyV2TopologyIdIpePolicy(null, (data, error) => {
6099
+ try {
6100
+ const displayE = 'topologyId is required';
6101
+ runErrorAsserts(data, error, 'AD.300', 'Test-paragon_pathfinder-adapter-deleteTopologyV2TopologyIdIpePolicy', displayE);
6102
+ done();
6103
+ } catch (err) {
6104
+ log.error(`Test Failure: ${err}`);
6105
+ done(err);
6106
+ }
6107
+ });
6108
+ } catch (error) {
6109
+ log.error(`Adapter Exception: ${error}`);
6110
+ done(error);
6111
+ }
6112
+ }).timeout(attemptTimeout);
6113
+ });
6114
+
6115
+ describe('#getTopologyV2TopologyIdIpePolicyIpePolicyId - errors', () => {
6116
+ it('should have a getTopologyV2TopologyIdIpePolicyIpePolicyId function', (done) => {
6117
+ try {
6118
+ assert.equal(true, typeof a.getTopologyV2TopologyIdIpePolicyIpePolicyId === 'function');
6119
+ done();
6120
+ } catch (error) {
6121
+ log.error(`Test Failure: ${error}`);
6122
+ done(error);
6123
+ }
6124
+ }).timeout(attemptTimeout);
6125
+ it('should error if - missing topologyId', (done) => {
6126
+ try {
6127
+ a.getTopologyV2TopologyIdIpePolicyIpePolicyId(null, null, (data, error) => {
6128
+ try {
6129
+ const displayE = 'topologyId is required';
6130
+ runErrorAsserts(data, error, 'AD.300', 'Test-paragon_pathfinder-adapter-getTopologyV2TopologyIdIpePolicyIpePolicyId', displayE);
6131
+ done();
6132
+ } catch (err) {
6133
+ log.error(`Test Failure: ${err}`);
6134
+ done(err);
6135
+ }
6136
+ });
6137
+ } catch (error) {
6138
+ log.error(`Adapter Exception: ${error}`);
6139
+ done(error);
6140
+ }
6141
+ }).timeout(attemptTimeout);
6142
+ it('should error if - missing ipePolicyId', (done) => {
6143
+ try {
6144
+ a.getTopologyV2TopologyIdIpePolicyIpePolicyId('fakeparam', null, (data, error) => {
6145
+ try {
6146
+ const displayE = 'ipePolicyId is required';
6147
+ runErrorAsserts(data, error, 'AD.300', 'Test-paragon_pathfinder-adapter-getTopologyV2TopologyIdIpePolicyIpePolicyId', displayE);
6148
+ done();
6149
+ } catch (err) {
6150
+ log.error(`Test Failure: ${err}`);
6151
+ done(err);
6152
+ }
6153
+ });
6154
+ } catch (error) {
6155
+ log.error(`Adapter Exception: ${error}`);
6156
+ done(error);
6157
+ }
6158
+ }).timeout(attemptTimeout);
6159
+ });
5998
6160
  });
5999
6161
  });