Merge "New test for configuration show --mask"
This commit is contained in:
commit
3a6cb49200
@ -13,19 +13,26 @@
|
|||||||
import os
|
import os
|
||||||
|
|
||||||
from functional.common import test
|
from functional.common import test
|
||||||
|
from openstackclient.common import configuration
|
||||||
|
|
||||||
|
|
||||||
BASIC_CONFIG_HEADERS = ['Field', 'Value']
|
BASIC_CONFIG_HEADERS = ['Field', 'Value']
|
||||||
|
|
||||||
|
|
||||||
class ConfigurationTests(test.TestCase):
|
class ConfigurationTests(test.TestCase):
|
||||||
|
|
||||||
|
opts = "-f value -c auth.password"
|
||||||
|
|
||||||
def test_configuration_show(self):
|
def test_configuration_show(self):
|
||||||
raw_output = self.openstack('configuration show')
|
raw_output = self.openstack('configuration show')
|
||||||
items = self.parse_listing(raw_output)
|
items = self.parse_listing(raw_output)
|
||||||
self.assert_table_structure(items, BASIC_CONFIG_HEADERS)
|
self.assert_table_structure(items, BASIC_CONFIG_HEADERS)
|
||||||
|
|
||||||
def test_configuration_show_unmask(self):
|
def test_configuration_show_unmask(self):
|
||||||
opts = "-f value -c auth.password"
|
raw_output = self.openstack('configuration show --unmask ' + self.opts)
|
||||||
raw_output = self.openstack('configuration show --unmask ' + opts)
|
|
||||||
passwd = os.environ['OS_PASSWORD']
|
passwd = os.environ['OS_PASSWORD']
|
||||||
self.assertOutput(passwd + '\n', raw_output)
|
self.assertOutput(passwd + '\n', raw_output)
|
||||||
|
|
||||||
|
def test_configuration_show_mask(self):
|
||||||
|
raw_output = self.openstack('configuration show --mask ' + self.opts)
|
||||||
|
self.assertOutput(configuration.REDACTED + '\n', raw_output)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user