from calvin.utilities import calvinlogger from calvin.utilities.utils import get_home from calvin.utilities import runtime_credentials from calvin.runtime.south.storage.twistedimpl.securedht.append_server import * from calvin.runtime.south.storage.twistedimpl.securedht.dht_server import * from calvin.runtime.south.storage.twistedimpl.securedht.service_discovery_ssdp import * from calvin.runtime.south.storage.twistedimpl.securedht.dht_server_commons import drawNetworkState from kademlia.node import Node from kademlia.utils import deferredDict, digest from calvin.runtime.south. async import threads from calvin.utilities import calvinconfig import socket from calvin.tests.helpers import get_ip_addr ip_addr = get_ip_addr() _log = calvinlogger.get_logger(__name__) name = "node4:" homefolder = get_home() domain = "sec-dht-security-test" testdir = os.path.join(homefolder, ".calvin", "sec_dht_security_test") configdir = os.path.join(testdir, domain) runtimesdir = os.path.join(testdir, "runtimes") runtimes_truststore = os.path.join(runtimesdir, "truststore_for_transport") _conf = calvinconfig.get() _conf.add_section("security") _conf.set('security', "runtimes_path", runtimesdir) _conf.set('security', "domain_name", domain) _conf.set('security', "security_path", testdir)
security_testdir = os.path.join(os.path.dirname(__file__), "security_test") domain_name="test_security_domain" code_signer_name="test_signer" orig_identity_provider_path = os.path.join(security_testdir,"identity_provider") identity_provider_path = os.path.join(credentials_testdir, "identity_provider") policy_storage_path = os.path.join(security_testdir, "policies") orig_actor_store_path = os.path.abspath(os.path.join(os.path.dirname( __file__ ), '..', 'actorstore','systemactors')) actor_store_path = os.path.join(credentials_testdir, "store") orig_application_store_path = os.path.join(security_testdir, "scripts") application_store_path = os.path.join(credentials_testdir, "scripts") NBR_OF_RUNTIMES=3 import socket from calvin.tests.helpers import get_ip_addr ip_addr = get_ip_addr() hostname = socket.gethostname() runtimes=[] request_handler=None storage_verified=False @pytest.mark.slow class TestSecurity(unittest.TestCase): @pytest.fixture(autouse=True, scope="class") def setup(self, request): from calvin.Tools.csruntime import csruntime from conftest import _config_pytest import fileinput