def test_ntp_servers(self): # First with just one server ic = InstanceConfig({'ntp_servers': [ntp_server1]}) config_json = ic.make_brkt_config_json() expected_json = '{"brkt": {"ntp_servers": ["%s"]}}' % ntp_server1 self.assertEqual(config_json, expected_json) # Now try two servers ic = InstanceConfig({'ntp_servers': [ntp_server1, ntp_server2]}) config_json = ic.make_brkt_config_json() expected_json = '{"brkt": {"ntp_servers": ["%s", "%s"]}}' % \ (ntp_server1, ntp_server2) self.assertEqual(config_json, expected_json)
def test_ntp_servers(self): # First with just one server ic = InstanceConfig({'ntp_servers': [ntp_server1]}) config_json = ic.make_brkt_config_json() expected_json = '{"brkt": {"ntp_servers": ["%s"]}}' % ntp_server1 self.assertEqual(config_json, expected_json) # Now try two servers ic = InstanceConfig({'ntp_servers': [ntp_server1, ntp_server2]}) config_json = ic.make_brkt_config_json() expected_json = '{"brkt": {"ntp_servers": ["%s", "%s"]}}' % \ (ntp_server1, ntp_server2) self.assertEqual(config_json, expected_json)
def test_brkt_env(self): brkt_config_in = { 'api_host': api_host_port, 'hsmproxy_host': hsmproxy_host_port } ic = InstanceConfig(brkt_config_in) config_json = ic.make_brkt_config_json() expected_json = '{"brkt": {"api_host": "%s", "hsmproxy_host": "%s"}}' % \ (api_host_port, hsmproxy_host_port) self.assertEqual(config_json, expected_json)
def test_brkt_env(self): brkt_config_in = { 'api_host': api_host_port, 'hsmproxy_host': hsmproxy_host_port } ic = InstanceConfig(brkt_config_in) config_json = ic.make_brkt_config_json() expected_json = '{"brkt": {"api_host": "%s", "hsmproxy_host": "%s"}}' % \ (api_host_port, hsmproxy_host_port) self.assertEqual(config_json, expected_json)
def test_jwt(self): ic = InstanceConfig({'identity_token': test_jwt}) config_json = ic.make_brkt_config_json() expected_json = '{"brkt": {"identity_token": "%s"}}' % test_jwt self.assertEqual(config_json, expected_json)
def test_jwt(self): ic = InstanceConfig({'identity_token': test_jwt}) config_json = ic.make_brkt_config_json() expected_json = '{"brkt": {"identity_token": "%s"}}' % test_jwt self.assertEqual(config_json, expected_json)