MCPcopy Create free account
hub / github.com/ElementsProject/elements / run_test

Method run_test

test/functional/rpc_users.py:89–115  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

87 assert_equal(401, call_with_auth(node, user + 'wrong', password + 'wrong').status)
88
89 def run_test(self):
90 self.log.info('Check correctness of the rpcauth config option')
91 url = urllib.parse.urlparse(self.nodes[0].url)
92
93 self.test_auth(self.nodes[0], url.username, url.password)
94 self.test_auth(self.nodes[0], 'rt', self.rtpassword)
95 self.test_auth(self.nodes[0], 'rt2', self.rt2password)
96 self.test_auth(self.nodes[0], self.user, self.password)
97
98 self.log.info('Check correctness of the rpcuser/rpcpassword config options')
99 url = urllib.parse.urlparse(self.nodes[1].url)
100
101 self.test_auth(self.nodes[1], self.rpcuser, self.rpcpassword)
102
103 init_error = 'Error: Unable to start HTTP server. See debug log for details.'
104
105 self.log.info('Check -rpcauth are validated')
106 # Empty -rpcauth= are ignored
107 self.restart_node(0, extra_args=['-rpcauth='])
108 self.stop_node(0)
109 self.nodes[0].assert_start_raises_init_error(expected_msg=init_error, extra_args=['-rpcauth=foo'])
110 self.nodes[0].assert_start_raises_init_error(expected_msg=init_error, extra_args=['-rpcauth=foo:bar'])
111
112 self.log.info('Check that failure to write cookie file will abort the node gracefully')
113 cookie_file = os.path.join(get_datadir_path(self.options.tmpdir, 0), self.chain, '.cookie.tmp')
114 os.mkdir(cookie_file)
115 self.nodes[0].assert_start_raises_init_error(expected_msg=init_error)
116
117
118if __name__ == '__main__':

Callers

nothing calls this directly

Calls 7

test_authMethod · 0.95
get_datadir_pathFunction · 0.90
infoMethod · 0.80
restart_nodeMethod · 0.45
stop_nodeMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected