|
79 | 79 | 'region_name': 'occ-cloud,krikkit,occ-env', |
80 | 80 | 'log_file': '/tmp/test_log_file', |
81 | 81 | 'log_level': 'debug', |
| 82 | + 'cert': 'mycert', |
| 83 | + 'key': 'mickey', |
82 | 84 | } |
83 | 85 | } |
84 | 86 | } |
@@ -567,6 +569,24 @@ def test_shell_args_ca_options(self): |
567 | 569 | self.assertEqual('foo', _shell.options.cacert) |
568 | 570 | self.assertFalse(_shell.verify) |
569 | 571 |
|
| 572 | + def test_shell_args_cert_options(self): |
| 573 | + _shell = make_shell() |
| 574 | + |
| 575 | + # Default |
| 576 | + fake_execute(_shell, "list user") |
| 577 | + self.assertEqual('', _shell.options.cert) |
| 578 | + self.assertEqual('', _shell.options.key) |
| 579 | + |
| 580 | + # --os-cert |
| 581 | + fake_execute(_shell, "--os-cert mycert list user") |
| 582 | + self.assertEqual('mycert', _shell.options.cert) |
| 583 | + self.assertEqual('', _shell.options.key) |
| 584 | + |
| 585 | + # --os-key |
| 586 | + fake_execute(_shell, "--os-key mickey list user") |
| 587 | + self.assertEqual('', _shell.options.cert) |
| 588 | + self.assertEqual('mickey', _shell.options.key) |
| 589 | + |
570 | 590 | def test_default_env(self): |
571 | 591 | flag = "" |
572 | 592 | kwargs = { |
@@ -670,6 +690,9 @@ def test_shell_args_cloud_public(self, config_mock, public_mock): |
670 | 690 | _shell.cloud.config['region_name'], |
671 | 691 | ) |
672 | 692 |
|
| 693 | + self.assertEqual('mycert', _shell.cloud.config['cert']) |
| 694 | + self.assertEqual('mickey', _shell.cloud.config['key']) |
| 695 | + |
673 | 696 | @mock.patch("os_client_config.config.OpenStackConfig._load_vendor_file") |
674 | 697 | @mock.patch("os_client_config.config.OpenStackConfig._load_config_file") |
675 | 698 | def test_shell_args_precedence(self, config_mock, vendor_mock): |
|
0 commit comments