Skip to content

Commit 235cd22

Browse files
Yunpeng LiSteve Martinelli
authored andcommitted
New test for configuration show --mask
Change-Id: I56bb110d25b9f05cb1a706ecc5bbf5b6b154b240
1 parent 4ebeb25 commit 235cd22

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

functional/tests/common/test_configuration.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,26 @@
1313
import os
1414

1515
from functional.common import test
16+
from openstackclient.common import configuration
17+
1618

1719
BASIC_CONFIG_HEADERS = ['Field', 'Value']
1820

1921

2022
class ConfigurationTests(test.TestCase):
2123

24+
opts = "-f value -c auth.password"
25+
2226
def test_configuration_show(self):
2327
raw_output = self.openstack('configuration show')
2428
items = self.parse_listing(raw_output)
2529
self.assert_table_structure(items, BASIC_CONFIG_HEADERS)
2630

2731
def test_configuration_show_unmask(self):
28-
opts = "-f value -c auth.password"
29-
raw_output = self.openstack('configuration show --unmask ' + opts)
32+
raw_output = self.openstack('configuration show --unmask ' + self.opts)
3033
passwd = os.environ['OS_PASSWORD']
3134
self.assertOutput(passwd + '\n', raw_output)
35+
36+
def test_configuration_show_mask(self):
37+
raw_output = self.openstack('configuration show --mask ' + self.opts)
38+
self.assertOutput(configuration.REDACTED + '\n', raw_output)

0 commit comments

Comments
 (0)