From d5c9b01b531f97c14a42ac45be484191cc3fbb40 Mon Sep 17 00:00:00 2001 From: Kevin Froman Date: Thu, 26 Mar 2020 03:46:49 -0500 Subject: [PATCH] * adjusted default config to scale better * test default config values for dev accidental changes * bump runtime result --- static-data/default_config.json | 12 ++++---- tests/runtime-result.txt | 2 +- tests/test_default_config_json.py | 48 +++++++++++++++++++++++++++++-- 3 files changed, 51 insertions(+), 11 deletions(-) diff --git a/static-data/default_config.json b/static-data/default_config.json index 6840772e..fabd57e2 100755 --- a/static-data/default_config.json +++ b/static-data/default_config.json @@ -3,13 +3,13 @@ "security_auditing": true }, "allocations": { - "disk": 1073741824, - "net_total": 1000000000 + "disk": 1073741824 }, "general": { "announce_node": true, "dev_mode": false, "display_header": true, + "ephemeral_tunnels": false, "hide_created_blocks": true, "insert_deniable_blocks": true, "max_block_age": 2678400, @@ -19,7 +19,6 @@ "random_bind_ip": true, "security_level": 0, "show_notifications": true, - "socket_servers": false, "store_plaintext_blocks": true, "use_bootstrap_list": true, "use_subprocess_pow_if_possible": true @@ -40,7 +39,7 @@ }, "peers": { "max_connect": 1000, - "max_stored_peers": 5000, + "max_stored_peers": 10000000, "minimum_score": -100 }, "plugins": { @@ -60,8 +59,7 @@ "existing_control_port": 0, "existing_socks_port": 0, "use_bridge": false, - "use_existing_tor": false, - "v3onions": true + "use_existing_tor": false }, "transports": { "lan": true, @@ -71,4 +69,4 @@ "ui": { "theme": "dark" } -} \ No newline at end of file +} diff --git a/tests/runtime-result.txt b/tests/runtime-result.txt index 546af05e..d19f62b1 100644 --- a/tests/runtime-result.txt +++ b/tests/runtime-result.txt @@ -1 +1 @@ -1585025509 \ No newline at end of file +1585212325 \ No newline at end of file diff --git a/tests/test_default_config_json.py b/tests/test_default_config_json.py index a373056b..4905c1f7 100644 --- a/tests/test_default_config_json.py +++ b/tests/test_default_config_json.py @@ -12,11 +12,53 @@ createdirs.create_dirs() class OnionrConfig(unittest.TestCase): def test_default_file(self): json.loads(readstatic.read_static('default_config.json')) - + def test_installed_config(self): import onionrsetup onionrsetup.setup_config() with open(TEST_DIR + 'config.json') as conf: - json.loads(conf.read()) - + conf = json.loads(conf.read()) + self.assertEqual(conf['advanced']['security_auditing'], True) + self.assertEqual(conf['allocations']['disk'], 1073741824) + self.assertEqual(conf['allocations']['disk'], 1073741824) + self.assertEqual(conf['general']['announce_node'], True) + self.assertEqual(conf['general']['dev_mode'], False) + self.assertEqual(conf['general']['display_header'], True) + self.assertEqual(conf['general']['ephemeral_tunnels'], False) + self.assertEqual(conf['general']['hide_created_blocks'], True) + self.assertEqual(conf['general']['insert_deniable_blocks'], True) + self.assertEqual(conf['general']['max_block_age'], 2678400) + self.assertEqual(conf['general']['minimum_block_pow'], 5) + self.assertEqual(conf['general']['minimum_send_pow'], 5) + self.assertEqual(conf['general']['public_key'], '') + self.assertEqual(conf['general']['random_bind_ip'], True) + self.assertEqual(conf['general']['security_level'], 0) + self.assertEqual(conf['general']['show_notifications'], True) + self.assertEqual(conf['general']['store_plaintext_blocks'], True) + self.assertEqual(conf['general']['use_bootstrap_list'], True) + self.assertEqual(conf['general']['use_subprocess_pow_if_possible'], True) + self.assertEqual(conf['log']['console']['color'], True) + self.assertEqual(conf['log']['console']['output'], True) + self.assertEqual(conf['log']['file']['output'], True) + self.assertEqual(conf['log']['file']['remove_on_exit'], True) + self.assertEqual(conf['log']['verbosity'], 'default') + self.assertEqual(conf['onboarding']['done'], False) + self.assertEqual(conf['peers']['max_connect'], 1000) + self.assertEqual(conf['peers']['max_stored_peers'], 10000000) + self.assertEqual(conf['peers']['minimum_score'], -100) + self.assertEqual(conf['plugins']['disabled'], ['chat']) + self.assertEqual(conf['plugins']['enabled'], []) + self.assertEqual(conf['timers']['getBlocks'], 10) + self.assertEqual(conf['timers']['lookupBlocks'], 25) + self.assertEqual(conf['tor']['bridge_fingerprint'], '') + self.assertEqual(conf['tor']['bridge_ip'], '') + self.assertEqual(conf['tor']['existing_control_password'], '') + self.assertEqual(conf['tor']['existing_control_port'], 0) + self.assertEqual(conf['tor']['existing_socks_port'], 0) + self.assertEqual(conf['tor']['use_bridge'], False) + self.assertEqual(conf['tor']['use_existing_tor'], False) + self.assertEqual(conf['transports']['lan'], True) + self.assertEqual(conf['transports']['manual_disk'], True) + self.assertEqual(conf['transports']['tor'], True) + self.assertEqual(conf['ui']['theme'], 'dark') unittest.main()