|
7 | 7 |
|
8 | 8 | import json |
9 | 9 |
|
10 | | - |
11 | 10 | from SoftLayer.CLI.exceptions import ArgumentError |
12 | 11 | from SoftLayer.CLI.exceptions import CLIHalt |
13 | 12 | from SoftLayer.fixtures import SoftLayer_Product_Order |
@@ -520,3 +519,41 @@ def test_ipsec_order(self): |
520 | 519 | order_mock.return_value = SoftLayer_Product_Order.ipsec_placeOrder |
521 | 520 | result = self.run_command(['ipsec', 'order', '-d', 'dal13']) |
522 | 521 | self.assert_no_fail(result) |
| 522 | + |
| 523 | + def test_ipsec_cancel(self): |
| 524 | + mock = self.set_mock('SoftLayer_Account', 'getNetworkTunnelContexts') |
| 525 | + mock.return_value = [{ |
| 526 | + "createDate": "2013-11-05T16:03:53-06:00", |
| 527 | + "id": 445, |
| 528 | + "internalPeerIpAddress": "184.172.127.9", |
| 529 | + "modifyDate": "2022-07-19T09:34:53-06:00", |
| 530 | + "name": "ipsec003", |
| 531 | + "phaseOneAuthentication": "MD5", |
| 532 | + "phaseOneDiffieHellmanGroup": 2, |
| 533 | + "phaseOneEncryption": "3DES", |
| 534 | + "phaseOneKeylife": 14400, |
| 535 | + "phaseTwoAuthentication": "MD5", |
| 536 | + "phaseTwoDiffieHellmanGroup": 2, |
| 537 | + "phaseTwoEncryption": "3DES", |
| 538 | + "phaseTwoKeylife": 3600, |
| 539 | + "phaseTwoPerfectForwardSecrecy": 1, |
| 540 | + "billingItem": { |
| 541 | + "allowCancellationFlag": 1, |
| 542 | + "categoryCode": "network_tunnel", |
| 543 | + "createDate": "2022-07-19T09:34:52-06:00", |
| 544 | + "cycleStartDate": "2022-08-03T23:07:43-06:00", |
| 545 | + "description": "IPSEC - Standard", |
| 546 | + "id": 977194617, |
| 547 | + "lastBillDate": "2022-08-03T23:07:43-06:00", |
| 548 | + "modifyDate": "2022-08-03T23:07:43-06:00", |
| 549 | + "nextBillDate": "2022-09-03T23:00:00-06:00", |
| 550 | + "oneTimeFee": "0", |
| 551 | + "orderItemId": 932515967, |
| 552 | + "recurringMonths": 1, |
| 553 | + "serviceProviderId": 1, |
| 554 | + }}] |
| 555 | + |
| 556 | + mock = self.set_mock('SoftLayer_Billing_Item', 'cancelItem') |
| 557 | + mock.return_value = True |
| 558 | + result = self.run_command(['ipsec', 'cancel', '445', '--immediate', '--reason', 'test']) |
| 559 | + self.assert_no_fail(result) |
0 commit comments