moved tests to parent directory

This commit is contained in:
Kevin Froman 2019-09-12 21:22:25 -05:00
parent ab49e3eaf6
commit 4f6f83f383
No known key found for this signature in database
GPG Key ID: 0D414D0FE405B63B
17 changed files with 31 additions and 18 deletions

2
.gitignore vendored
View File

@ -20,7 +20,7 @@ core
venv/*
onionr/fs*
onionr/tmp/*
testdata/*
*.dll
*.exe

View File

@ -17,7 +17,7 @@ The following exploits are of particular interest:
* Discovering true server IPs when behind Tor/I2P (aside from Tor/i2p-level attacks)
* Easily discovering which nodes are the block creator
* XSS, CSRF, clickjacking, DNS rebinding
* Timing attacks against the local http server ([see blog post](https://www.chaoswebs.net/blog/timebleed-breaking-privacy-with-a-simple-timing-attack.html))
* Timing attacks against the local http server that are exploitable from a browser ([see blog post](https://www.chaoswebs.net/blog/timebleed-breaking-privacy-with-a-simple-timing-attack.html))
* Discovering direct connection servers as a non participant.
* Cryptography/protocol issues
* Denying nodes access to the network by segmenting them out with Sybil nodes

View File

@ -1,5 +1,4 @@
#!/bin/bash
cd onionr;
rm -rf testdata;
mkdir testdata;
ran=0
@ -14,4 +13,4 @@ for f in tests/*.py; do
python3 "$f" || close # if needed
let "ran++"
done
echo "ran $ran test files successfully in $SECONDS seconds"
echo "ran $ran test files successfully in $SECONDS seconds"

View File

@ -1,6 +1,7 @@
#!/usr/bin/env python3
import sys, os
sys.path.append(".")
sys.path.append("onionr/")
import unittest, uuid, hashlib
import onionrblocks
@ -30,4 +31,4 @@ class OnionrBlockTests(unittest.TestCase):
bl = onionrblocks.insert(message, asymPeer=onionrcrypto.pub_key)
self.assertIn(bytesconverter.str_to_bytes(message), onionrblockapi.Block(bl, decrypt=True).bcontent)
unittest.main()
unittest.main()

View File

@ -1,6 +1,7 @@
from unittest.mock import patch
import sys, os
sys.path.append(".")
sys.path.append("onionr/")
import unittest, uuid
TEST_DIR = 'testdata/%s-%s' % (uuid.uuid4(), os.path.basename(__file__)) + '/'
print("Test directory:", TEST_DIR)
@ -16,4 +17,4 @@ class OnionrTests(unittest.TestCase):
with patch.object(sys, 'argv', testargs):
parser.register()
unittest.main()
unittest.main()

View File

@ -1,6 +1,7 @@
#!/usr/bin/env python3
import sys, os
sys.path.append(".")
sys.path.append("onionr/")
import unittest, uuid, sqlite3
TEST_DIR = 'testdata/%s-%s' % (uuid.uuid4(), os.path.basename(__file__)) + '/'
print("Test directory:", TEST_DIR)
@ -36,4 +37,4 @@ class OnionrTests(unittest.TestCase):
keydb.transportinfo.set_address_info(adder, 'success', 1000)
self.assertEqual(keydb.transportinfo.get_address_info(adder, 'success'), 1000)
unittest.main()
unittest.main()

View File

@ -1,5 +1,6 @@
import sys, os
sys.path.append(".")
sys.path.append("onionr/")
import unittest, uuid, json
TEST_DIR = 'testdata/%s-%s' % (uuid.uuid4(), os.path.basename(__file__)) + '/'
print("Test directory:", TEST_DIR)
@ -18,4 +19,4 @@ class OnionrConfig(unittest.TestCase):
with open(TEST_DIR + 'config.json') as conf:
json.loads(conf.read())
unittest.main()
unittest.main()

View File

@ -1,6 +1,7 @@
#!/usr/bin/env python3
import sys, os, random
sys.path.append(".")
sys.path.append("onionr/")
import unittest, uuid
TEST_DIR_1 = 'testdata/%s-%s' % (uuid.uuid4(), os.path.basename(__file__)) + '/'
TEST_DIR_2 = 'testdata/%s-%s' % (uuid.uuid4(), os.path.basename(__file__)) + '/'
@ -40,4 +41,4 @@ class OnionrForwardSecrecyTests(unittest.TestCase):
self.assertEqual(decrypted, message.encode())
return
unittest.main()
unittest.main()

View File

@ -1,6 +1,7 @@
#!/usr/bin/env python3
import sys, os
sys.path.append(".")
sys.path.append("onionr/")
import unittest, uuid
TEST_DIR = 'testdata/%s-%s' % (uuid.uuid4(), os.path.basename(__file__)) + '/'
@ -13,4 +14,4 @@ class GetOpenPortTest(unittest.TestCase):
open_port = int(netcontroller.get_open_port())
self.assertGreaterEqual(open_port, 1024)
unittest.main()
unittest.main()

View File

@ -1,6 +1,7 @@
#!/usr/bin/env python3
import sys, os
sys.path.append(".")
sys.path.append("onionr/")
import unittest, uuid, hashlib, base64
import nacl.exceptions
import nacl.signing, nacl.hash, nacl.encoding
@ -118,4 +119,4 @@ class OnionrCryptoTests(unittest.TestCase):
self.assertTrue(gen1 == gen2)
self.assertTrue(stringvalidators.validate_pub_key(gen1[0]))
unittest.main()
unittest.main()

View File

@ -1,6 +1,7 @@
#!/usr/bin/env python3
import sys, os
sys.path.append(".")
sys.path.append("onionr/")
import unittest, uuid
from utils import identifyhome
@ -12,4 +13,4 @@ class IdentifyHomeTest(unittest.TestCase):
os.environ["ONIONR_HOME"] = "testhome"
self.assertEqual(os.getcwd() + "/testhome/", identifyhome.identify_home())
unittest.main()
unittest.main()

View File

@ -1,6 +1,7 @@
#!/usr/bin/env python3
import sys, os
sys.path.append(".")
sys.path.append("onionr/")
import unittest, uuid
TEST_DIR = 'testdata/%s-%s' % (uuid.uuid4(), os.path.basename(__file__)) + '/'
@ -35,4 +36,4 @@ class KeyManagerTest(unittest.TestCase):
with open(filepaths.keys_file, 'r') as keyfile:
self.assertNotIn(new_key, keyfile.read())
unittest.main()
unittest.main()

View File

@ -1,6 +1,7 @@
#!/usr/bin/env python3
import sys, os
sys.path.append(".")
sys.path.append("onionr/")
import unittest, uuid
TEST_DIR = 'testdata/%s-%s' % (uuid.uuid4(), os.path.basename(__file__)) + '/'
@ -28,4 +29,4 @@ class NetworkMergerTest(unittest.TestCase):
for adder in adders:
self.assertNotIn(adder, added)
unittest.main()
unittest.main()

View File

@ -1,6 +1,7 @@
#!/usr/bin/env python3
import sys, os
sys.path.append(".")
sys.path.append("onionr/")
import unittest, uuid
import json
TEST_DIR = 'testdata/%s-%s' % (uuid.uuid4(), os.path.basename(__file__)) + '/'
@ -89,4 +90,4 @@ class OnionrUserTests(unittest.TestCase):
else:
self.assertTrue(False)
unittest.main()
unittest.main()

View File

@ -1,5 +1,6 @@
import sys, os
sys.path.append(".")
sys.path.append("onionr/")
import unittest, uuid
TEST_DIR = 'testdata/%s-%s' % (uuid.uuid4(), os.path.basename(__file__)) + '/'
@ -44,4 +45,4 @@ class TestStorageCounter(unittest.TestCase):
self.assertEqual(counter.get_amount(), start_value)
unittest.main()
unittest.main()

View File

@ -1,6 +1,7 @@
#!/usr/bin/env python3
import sys, os
sys.path.append(".")
sys.path.append("onionr/")
import unittest, uuid
TEST_DIR = 'testdata/%s-%s' % (uuid.uuid4(), os.path.basename(__file__)) + '/'
print("Test directory:", TEST_DIR)
@ -68,4 +69,4 @@ class OnionrValidations(unittest.TestCase):
#print('testing', x)
self.assertFalse(stringvalidators.is_integer_string(x))
unittest.main()
unittest.main()

View File

@ -1,6 +1,7 @@
#!/usr/bin/env python3
import unittest, sys
sys.path.append(".")
sys.path.append("onionr/")
from utils import reconstructhash
@ -18,4 +19,4 @@ class ZFill_Hash(unittest.TestCase):
h = "0000e918d24999ad9b0ff00c1d414f36b74afc93871a0ece4bd452f82b56af87"
h_no = "e918d24999ad9b0ff00c1d414f36b74afc93871a0ece4bd452f82b56af87"
self.assertEqual(reconstructhash.deconstruct_hash(h), h_no)
unittest.main()
unittest.main()