Browse Source

test suite: minor fixes

The MMGen Project 5 months ago
parent
commit
9638a96ec6

+ 2 - 0
test/cmdtest_d/autosign.py

@@ -300,6 +300,8 @@ class CmdTestAutosignBase(CmdTestBase):
 					' '.join(sorted(i.name for i in d.iterdir()))).strip()
 
 class CmdTestAutosignClean(CmdTestAutosignBase):
+	'autosign directory cleaning operations'
+
 	have_online     = False
 	live            = False
 	simulate_led    = True

+ 1 - 0
test/cmdtest_d/ethbump.py

@@ -434,6 +434,7 @@ class CmdTestEthBump(CmdTestEthBumpMethods, CmdTestEthSwapMethods, CmdTestSwapMe
 		return self._thornode_server_stop()
 
 class CmdTestEthBumpLTC(CmdTestSwapMethods, CmdTestRegtest):
+	'Ethereum transaction bumping operations - LTC wallet'
 	network = ('ltc',)
 	tmpdir_nums = [43]
 	is_helper = True

+ 1 - 1
test/cmdtest_d/help.py

@@ -21,7 +21,7 @@ from .base import CmdTestBase
 
 class CmdTestHelp(CmdTestBase):
 	'help, info and usage screens'
-	networks = ('btc', 'ltc', 'bch', 'eth', 'xmr', 'doge')
+	networks = ('btc', 'ltc', 'bch', 'eth', 'xmr', 'doge', 'rune')
 	passthru_opts = ('daemon_data_dir', 'rpc_port', 'coin', 'testnet')
 	cmd_group = (
 		('usage1',            (1, 'usage message (via --usage)', [])),

+ 4 - 2
test/cmdtest_d/httpd/thornode/rpc.py

@@ -23,6 +23,8 @@ class ThornodeRPCServer(ThornodeServer):
 
 	def make_response_body(self, method, environ):
 		req_str = request_uri(environ)
+		if method == 'POST':
+			length = int(environ.get('CONTENT_LENGTH', '0'))
 
 		if re.search(r'/bank/balances/(\S+)', req_str):
 			res = [
@@ -38,7 +40,7 @@ class ThornodeRPCServer(ThornodeServer):
 					'sequence': '333444'}}
 		elif m := re.search(r'/tx$', req_str):
 			assert method == 'POST'
-			txid = environ['wsgi.input'].read(71).decode().removeprefix('hash=0x').upper()
+			txid = environ['wsgi.input'].read(length).decode().removeprefix('hash=0x').upper()
 			res = {
 				'hash': txid,
 				'height': '21298600',
@@ -62,7 +64,7 @@ class ThornodeRPCServer(ThornodeServer):
 				'codespace': ''}
 		elif m := re.search(r'/broadcast_tx_sync$', req_str):
 			assert method == 'POST'
-			txhex = environ['wsgi.input'].read(24).decode().removeprefix('tx=0x').upper()
+			txhex = environ['wsgi.input'].read(length).decode().removeprefix('tx=0x').upper()
 			res = {'code': 0, 'codespace': '', 'data': '', 'log': ''}
 			if txhex.startswith('0A540A52'):
 				res.update({'hash': '14463C716CF08A814868DB779156BCD85A1DF8EE49E924900A74482E9DEE132D'})

+ 2 - 0
test/cmdtest_d/swap.py

@@ -305,6 +305,8 @@ class CmdTestSwapMethods:
 		return ret
 
 class CmdTestSwap(CmdTestSwapMethods, CmdTestRegtest, CmdTestAutosignThreaded):
+	'swap operations for BTC, BCH and LTC'
+
 	bdb_wallet = True
 	networks = ('btc',)
 	tmpdir_nums = [37]

+ 1 - 0
test/test-release.d/cfg.sh

@@ -167,6 +167,7 @@ init_tests() {
 		a $cmdtest_py --coin=bch help
 		a $cmdtest_py --coin=eth help
 		a $cmdtest_py --coin=xmr help
+		a $cmdtest_py --coin=rune help
 		a $cmdtest_py --coin=doge help:helpscreens help:longhelpscreens
 	"
 	[ "$SKIP_ALT_DEP" ] && t_help_skip='a'