+ added more tests

* fixed chdir home bug
* fixed some tests creating normal data dir
This commit is contained in:
Kevin Froman 2020-03-04 00:59:29 -06:00
parent 665cb0c732
commit 60d2ebfaed
20 changed files with 139 additions and 55 deletions

View file

@ -12,6 +12,7 @@ from . import ownnode
from .webpasstest import webpass_test
from .osver import test_os_ver_endpoint
from .clearnettor import test_clearnet_tor_request
from .housekeeping import test_inserted_housekeeping
"""
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -34,7 +35,8 @@ RUN_TESTS = [uicheck.check_ui,
stresstest.stress_test_block_insert,
webpass_test,
test_os_ver_endpoint,
test_clearnet_tor_request
test_clearnet_tor_request,
test_inserted_housekeeping
]
SUCCESS_FILE = os.path.dirname(os.path.realpath(__file__)) + '/../../tests/runtime-result.txt'

View file

@ -0,0 +1,25 @@
import os
from gevent import sleep
from onionrblocks import insert
import logger
from coredb.blockmetadb import get_block_list
from onionrutils import epoch
def test_inserted_housekeeping(testmanager):
"""Tests that inserted blocks are proprely deleted"""
bl = insert('testdata', expire=12)
wait_seconds = 132 # Wait two minutes plus expire time
count = 0
if bl in get_block_list():
while count < wait_seconds:
if bl in get_block_list():
sleep(1)
count += 1
else:
return
raise ValueError('Inserted block with expiry not erased')
else:
raise ValueError('Inserted block in expiry test not present in list')