From a42de79292d9541db7865b54e93be2d0b6e6a094 Mon Sep 17 00:00:00 2001 From: "serena.spinoso" Date: Thu, 7 Sep 2017 10:22:39 +0200 Subject: update verigraph JIRA: PARSER-154 code optimizations about graph manipulation and formula generation. Change-Id: Idebef19b128281aa2bc40d1aeab6e208c7ddd93d Signed-off-by: serena.spinoso --- verigraph/tester/README.md | 38 ---- verigraph/tester/test.py | 173 ++++++++++----- verigraph/tester/testcase_schema.json | 8 +- .../test_budapest_sap1_webserver_sat.json | 246 +++++++++++---------- .../test_budapest_sap1_webserver_unsat.json | 246 +++++++++++---------- ...test_user_nat_dpi_webserver_trafficAllowed.json | 116 +++++----- ...test_user_nat_dpi_webserver_trafficBlocked.json | 116 +++++----- ...test_user_nat_vpn_fieldmod_webserver_unsat.json | 94 -------- .../testcases/test_user_nat_vpn_webserver_sat.json | 82 ------- .../test_webserver_vpn_nat_user_unsat.json | 82 ------- 10 files changed, 486 insertions(+), 715 deletions(-) delete mode 100644 verigraph/tester/README.md delete mode 100644 verigraph/tester/testcases/test_user_nat_vpn_fieldmod_webserver_unsat.json delete mode 100644 verigraph/tester/testcases/test_user_nat_vpn_webserver_sat.json delete mode 100644 verigraph/tester/testcases/test_webserver_vpn_nat_user_unsat.json (limited to 'verigraph/tester') diff --git a/verigraph/tester/README.md b/verigraph/tester/README.md deleted file mode 100644 index 35396a3..0000000 --- a/verigraph/tester/README.md +++ /dev/null @@ -1,38 +0,0 @@ -.. This work is licensed under a Creative Commons Attribution 4.0 International License. -.. http://creativecommons.org/licenses/by/4.0 - -In order to run the automatic testing script test.py, you need the -following dependencies installed on your python distribution: - -- "requests" python package -> - http://docs.python-requests.org/en/master/ -- "jsonschema" python package -> - https://pypi.python.org/pypi/jsonschema - -IMPORTANT - If you have multiple versions of Python installed on your -machine, check carefully that the version you are actually using when -running the script, has the required packages installed. Requested -version is Python 3+ - -| HINT - to install a package you can raise the following command (Bash - on Linux or DOS shell on Windows): -| python -m pip install jsonschema -| python -m pip install requests - -Tested on PYTHON 3.4.3 - -To add a new test, just put a new .json file inside the testcases -folder. The corresponding JSON schema is in the testcase\_schema.json -file and some examples are already available. Each json file should -specify: - -- id, an integer for the testcase; -- name, the name for the testcase; -- description, an optional description; -- policy\_url\_parameters, the parameters to be appended after the - verification URL (including the '?' character); -- result, the expected verification result; -- graph, the graph to be tested (the same object that you usually POST - to VeriGraph to create a new graph). - The test.py script will test each .json file contained into the - testcases folder and will provide a complete output. diff --git a/verigraph/tester/test.py b/verigraph/tester/test.py index ad0b82a..ee5f6a2 100644 --- a/verigraph/tester/test.py +++ b/verigraph/tester/test.py @@ -1,5 +1,4 @@ #!/usr/bin/python - ############################################################################## # Copyright (c) 2017 Politecnico di Torino and others. # @@ -20,17 +19,25 @@ import json import getopt import os import subprocess +import csv +import datetime +import time +import re +import argparse + # Constants (change them, if appropriate) VERIGRAPH_PORT = "8080" TEST_CASES_DIR = "testcases" -BASE_URL = "http://localhost:"+VERIGRAPH_PORT+"/verify/api/graphs/" +BASE_URL = "http://localhost:"+VERIGRAPH_PORT+"/verigraph/api/graphs/" SCHEMA_FILE = "testcase_schema.json" # Variables -success = 0 +fail = 0 run = 0 +tests_number = 1 + # Utils def eprint(toPrint): sys.stdout.flush() @@ -46,70 +53,116 @@ try: except ValueError: eprint("Invalid json schema (check your "+SCHEMA_FILE+")!\nExiting.") exit(-1) +with open('result.csv', 'w') as file: + writer=csv.writer(file, delimiter=',', quoting=csv.QUOTE_MINIMAL, lineterminator='\n') + writer.writerow(['SRC','DST','GRAPH_ID','TEST_ID','RESULT','TIMES (ms)']) + # Iterate over .json files contained in the TEST_CASES_DIR + for i in os.listdir(TEST_CASES_DIR): + if i.endswith(".json"): + with open(TEST_CASES_DIR+os.path.sep+i) as data_file: + try: + # Load json file (raise exception if malformed) + data = json.load(data_file) + + # Validate input json against schema (raise exception if invalid) + validate(data, schema) + + + parser = argparse.ArgumentParser(description='iteration number') + parser.add_argument('-iteration') + args = vars(parser.parse_args()) + tests_number=args['iteration'][0] + + print("Test case ID: "+str(data["id"])) + print("\tFILE NAME: "+i) + print("\tTEST NAME: "+data["name"]) + print("\tTEST DESCRIPTION: "+data["description"]) + + requested=data["policy_url_parameters"] + results=data["results"] + + if(len(requested)==len(results)): + + run += 1 + # POST the graph + r = requests.post(BASE_URL, json=data["graph"]) + if r.status_code == 201: + graph_id = r.json()["id"] + print("\tCreated Graph has ID " + str(graph_id) + " on VeriGraph") + + for i in range(len(requested)): + print("request #: "+str(i)) + output=[] + total_time=[] + result=[] + temp=requested[i] + temp=re.split(r'[&=]', temp) + output.append(temp[3]) + output.append(temp[5]) + + #range(0, n)) where n is the number of tests to execute for every request (1 is the default) + for n in range(0, int(tests_number)): + start_time=datetime.datetime.now() + # GET the policy verification result + policy = requests.get(BASE_URL+str(graph_id)+"/policy"+data["policy_url_parameters"][i]) + total_time.append(int((datetime.datetime.now()-start_time).total_seconds() * 1000)) + + # Check the response + if policy.status_code == 200: + print("\tVerification result is " + policy.json()["result"]) + + # Check the result with the expected one + if policy.json()["result"] == data["results"][i]: + # SUCCESS + print("\t+++ Test passed +++") + if n==0: + result.append(policy.json()["result"]) -# Iterate over .json files contained in the TEST_CASES_DIR -for i in os.listdir(TEST_CASES_DIR): - if i.endswith(".json"): - with open(TEST_CASES_DIR+os.path.sep+i) as data_file: - try: - # Load json file (raise exception if malformed) - data = json.load(data_file) - - # Validate input json against schema (raise exception if invalid) - validate(data, schema) - - run += 1 - print("Test case ID: "+str(data["id"])) - print("\tFILE NAME: "+i) - print("\tTEST NAME: "+data["name"]) - print("\tTEST DESCRIPTION: "+data["description"]) - - # POST the graph - r = requests.post(BASE_URL, json=data["graph"]) - if r.status_code == 201: - graph_id = r.json()["id"] - print("\tCreated Graph has ID " + str(graph_id) + " on VeriGraph") - - # GET the policy verification result - policy = requests.get(BASE_URL+str(graph_id)+"/policy"+data["policy_url_parameters"]) - - # Check the response - if policy.status_code == 200: - print("\tVerification result is " + policy.json()["result"]) - - # Check the result with the expected one - if policy.json()["result"] == data["result"]: - # SUCCESS - print("\t+++ Test passed +++") - success += 1 - else: - # FAIL - eprint("\t[ERROR] Expected result was " + data["result"] + " but VeriGraph returned " + policy.json()["result"]) - print("\t--- Test failed ---") + else: + # FAIL + #eprint("\t[ERROR] Expected result was " + data["result"][i] + " but VeriGraph returned " + policy.json()["result"]) + result.append("FAIL") + fail+=1 + print("\t--- Test failed ---") + else: + print("\tVeriGraph returned an unexpected response -> " + str(policy.status_code), policy.reason) + fail+=1 + print("\t--- Test failed ---") + if(policy.status_code == 200): + output.append(graph_id) + output.append(data["id"]) + output.append(result[0]) + for j in range(len(total_time)): + output.append(total_time[j]) + writer.writerow(output) + else: + output.append("Error") + output.append("Policy code="+str(policy.status_code)) + writer.writerow(output) + print() else: - print("\tVeriGraph returned an unexpected response -> " + str(policy.status_code), policy.reason) - print("\t--- Test failed ---") - print() - except ValueError: - print("Malformed json!\nSkipping "+i+" file") - print("\t--- Test failed ---") - except ValidationError: - print("Invalid json (see Schema file)!\nSkipping "+i+" file") - print("\t--- Test failed ---") - except ConnectionError: - print("Connection refused!") - print("\t--- Test failed ---") - except HTTPError: - print("HTTP error!") - print("\t--- Test failed ---") + print("\tThe number of requests ("+str(len(requested))+")is not equal to the numer of results ("+str(len(results))+")") + print("\tPlease check the testcases file") + except ValueError: + print("Malformed json!\nSkipping "+i+" file") + print("\t--- Test failed ---") + except ValidationError: + print("Invalid json (see Schema file)!\nSkipping "+i+" file") + print("\t--- Test failed ---") + except ConnectionError: + print("Connection refused!") + print("\t--- Test failed ---") + except HTTPError: + print("HTTP error!") + print("\t--- Test failed ---") # Final output print("\nTest run = "+str(run)) -print("Test succeded = "+str(success)) if run != 0: - if success != run: + if fail != 0: print("\n --- Some tests failed. See the output. ---") else: print("\n +++ All tests passed +++") else: - print("\n\n +++ 0 tests executed +++") \ No newline at end of file + print("\n\n +++ 0 tests executed +++") + \ No newline at end of file diff --git a/verigraph/tester/testcase_schema.json b/verigraph/tester/testcase_schema.json index b069705..946bc02 100644 --- a/verigraph/tester/testcase_schema.json +++ b/verigraph/tester/testcase_schema.json @@ -18,16 +18,16 @@ }, "policy_url_parameters": { "description": "The set of parameters to be passed in GET request to the verification service", - "type": "string" + "type": "array" }, - "result": { + "results": { "description": "The set of parameters to be passed in GET request to the verification service", - "type": "string" + "type": "array" }, "graph": { "description": "The graph to be tested", "type": "object" } }, - "required": ["id", "name", "policy_url_parameters", "result", "graph"] + "required": ["id", "name", "policy_url_parameters", "results", "graph"] } \ No newline at end of file diff --git a/verigraph/tester/testcases/test_budapest_sap1_webserver_sat.json b/verigraph/tester/testcases/test_budapest_sap1_webserver_sat.json index 62b4eb5..6a64eea 100644 --- a/verigraph/tester/testcases/test_budapest_sap1_webserver_sat.json +++ b/verigraph/tester/testcases/test_budapest_sap1_webserver_sat.json @@ -1,122 +1,128 @@ { - "id":6, - "name":"budapest_test_case_sat", - "description":"This test case verifies budapest scenario, chain sap1->webserver1", - "policy_url_parameters":"?type=reachability&source=sap1&destination=webserver1", - "result":"SAT", - "graph": { - "nodes":[ - { - "neighbours":[ - { - "name":"webserver1" - }, - { - "name":"nat" - } - ], - "configuration":[ - { - "ip_sap1":"webserver1" - } - ], - "name":"fw", - "functional_type":"firewall" - }, - { - "neighbours":[ - { - "name":"sap3" - }, - { - "name":"fw" - } - ], - "name":"webserver1", - "functional_type":"webserver" - }, - { - "neighbours":[ - { - "name":"sap1" - }, - { - "name":"dpi" - }, - { - "name":"fw" - } - ], - "configuration":[ - "sap1", - "sap2" - ], - "name":"nat", - "functional_type":"nat" - }, - { - "neighbours":[ - { - "name":"sap2" - } - ], - "configuration":[ - "drug" - ], - "name":"dpi", - "functional_type":"dpi" - }, - { - "neighbours":[ - { - "name":"nat" - } - ], - "configuration":[ - { - "url":"www.facebook.com", - "body":"cats", - "destination":"webserver1", - "protocol":"HTTP_REQUEST" - } - ], - "name":"sap2", - "functional_type":"endhost" - }, - { - "neighbours":[ - { - "name":"nat" - } - ], - "configuration":[ - { - "url":"www.facebook.com", - "body":"cats", - "destination":"webserver1", - "protocol":"HTTP_REQUEST" - } - ], - "name":"sap1", - "functional_type":"endhost" - }, - { - "neighbours":[ - { - "name":"webserver1" - } - ], - "configuration":[ - { - "url":"www.facebook.com", - "body":"cats", - "destination":"webserver1", - "protocol":"HTTP_REQUEST" - } - ], - "name":"sap3", - "functional_type":"endhost" - } - ] - } + "id": 6, + "name": "budapest_test_case_sat", + "description": "This test case verifies budapest scenario, chain sap1->webserver1", + "policy_url_parameters": [ + "?type=reachability&source=sap1&destination=webserver1", + "?type=reachability&source=sap3&destination=webserver1" + ], + "results": [ + "SAT", + "SAT" + ], + "graph": { + "nodes": [ + { + "neighbours": [ + { + "name": "webserver1" + }, + { + "name": "nat" + } + ], + "configuration": [ + { + "sap1": "webserver1" + } + ], + "name": "fw", + "functional_type": "firewall" + }, + { + "neighbours": [ + { + "name": "sap3" + }, + { + "name": "fw" + } + ], + "name": "webserver1", + "functional_type": "webserver" + }, + { + "neighbours": [ + { + "name": "sap1" + }, + { + "name": "dpi" + }, + { + "name": "fw" + } + ], + "configuration": [ + "sap1", + "sap2" + ], + "name": "nat", + "functional_type": "nat" + }, + { + "neighbours": [ + { + "name": "sap2" + } + ], + "configuration": [ + "drug" + ], + "name": "dpi", + "functional_type": "dpi" + }, + { + "neighbours": [ + { + "name": "nat" + } + ], + "configuration": [ + { + "url": "www.facebook.com", + "body": "cats", + "destination": "webserver1", + "protocol": "HTTP_REQUEST" + } + ], + "name": "sap2", + "functional_type": "endhost" + }, + { + "neighbours": [ + { + "name": "nat" + } + ], + "configuration": [ + { + "url": "www.facebook.com", + "body": "cats", + "destination": "webserver1", + "protocol": "HTTP_REQUEST" + } + ], + "name": "sap1", + "functional_type": "endhost" + }, + { + "neighbours": [ + { + "name": "webserver1" + } + ], + "configuration": [ + { + "url": "www.facebook.com", + "body": "cats", + "destination": "webserver1", + "protocol": "HTTP_REQUEST" + } + ], + "name": "sap3", + "functional_type": "endhost" + } + ] + } } \ No newline at end of file diff --git a/verigraph/tester/testcases/test_budapest_sap1_webserver_unsat.json b/verigraph/tester/testcases/test_budapest_sap1_webserver_unsat.json index 211b310..e74194d 100644 --- a/verigraph/tester/testcases/test_budapest_sap1_webserver_unsat.json +++ b/verigraph/tester/testcases/test_budapest_sap1_webserver_unsat.json @@ -1,122 +1,126 @@ -{ - "id":7, - "name":"budapest_test_case_unsat", - "description":"This test case verifies budapest scenario, chain sap1->webserver1 with fw blocking", - "policy_url_parameters":"?type=reachability&source=sap1&destination=webserver1", - "result":"UNSAT", - "graph":{ - "nodes":[ - { - "neighbours":[ - { - "name":"webserver1" - }, - { - "name":"nat" - } - ], - "configuration":[ - { - "webserver1":"nat" - } - ], - "name":"fw", - "functional_type":"firewall" - }, - { - "neighbours":[ - { - "name":"sap3" - }, - { - "name":"fw" - } - ], - "name":"webserver1", - "functional_type":"webserver" - }, - { - "neighbours":[ - { - "name":"sap1" - }, - { - "name":"dpi" - }, - { - "name":"fw" - } - ], - "configuration":[ - "sap1", - "sap2" - ], - "name":"nat", - "functional_type":"nat" - }, - { - "neighbours":[ - { - "name":"sap2" - } - ], - "configuration":[ - "drug" - ], - "name":"dpi", - "functional_type":"dpi" - }, - { - "neighbours":[ - { - "name":"nat" - } - ], - "configuration":[ - { - "url":"www.facebook.com", - "body":"cats", - "destination":"webserver1", - "protocol":"HTTP_REQUEST" - } - ], - "name":"sap2", - "functional_type":"endhost" - }, - { - "neighbours":[ - { - "name":"nat" - } - ], - "configuration":[ - { - "url":"www.facebook.com", - "body":"cats", - "destination":"webserver1", - "protocol":"HTTP_REQUEST" - } - ], - "name":"sap1", - "functional_type":"endhost" - }, - { - "neighbours":[ - { - "name":"webserver1" - } - ], - "configuration":[ - { - "url":"www.facebook.com", - "body":"cats", - "destination":"webserver1", - "protocol":"HTTP_REQUEST" - } - ], - "name":"sap3", - "functional_type":"endhost" - } - ] - } +{ + "id": 7, + "name": "budapest_test_case_unsat", + "description": "This test case verifies budapest scenario, chain sap1->webserver1 with fw blocking", + "policy_url_parameters": [ + "?type=reachability&source=sap1&destination=webserver1" + ], + "results": [ + "UNSAT" + ], + "graph": { + "nodes": [ + { + "neighbours": [ + { + "name": "webserver1" + }, + { + "name": "nat" + } + ], + "configuration": [ + { + "webserver1": "nat" + } + ], + "name": "fw", + "functional_type": "firewall" + }, + { + "neighbours": [ + { + "name": "sap3" + }, + { + "name": "fw" + } + ], + "name": "webserver1", + "functional_type": "webserver" + }, + { + "neighbours": [ + { + "name": "sap1" + }, + { + "name": "dpi" + }, + { + "name": "fw" + } + ], + "configuration": [ + "sap1", + "sap2" + ], + "name": "nat", + "functional_type": "nat" + }, + { + "neighbours": [ + { + "name": "sap2" + } + ], + "configuration": [ + "drug" + ], + "name": "dpi", + "functional_type": "dpi" + }, + { + "neighbours": [ + { + "name": "nat" + } + ], + "configuration": [ + { + "url": "www.facebook.com", + "body": "cats", + "destination": "webserver1", + "protocol": "HTTP_REQUEST" + } + ], + "name": "sap2", + "functional_type": "endhost" + }, + { + "neighbours": [ + { + "name": "nat" + } + ], + "configuration": [ + { + "url": "www.facebook.com", + "body": "cats", + "destination": "webserver1", + "protocol": "HTTP_REQUEST" + } + ], + "name": "sap1", + "functional_type": "endhost" + }, + { + "neighbours": [ + { + "name": "webserver1" + } + ], + "configuration": [ + { + "url": "www.facebook.com", + "body": "cats", + "destination": "webserver1", + "protocol": "HTTP_REQUEST" + } + ], + "name": "sap3", + "functional_type": "endhost" + } + ] + } } \ No newline at end of file diff --git a/verigraph/tester/testcases/test_user_nat_dpi_webserver_trafficAllowed.json b/verigraph/tester/testcases/test_user_nat_dpi_webserver_trafficAllowed.json index 8e19352..227781c 100644 --- a/verigraph/tester/testcases/test_user_nat_dpi_webserver_trafficAllowed.json +++ b/verigraph/tester/testcases/test_user_nat_dpi_webserver_trafficAllowed.json @@ -1,59 +1,61 @@ { - "id": 2, - "name": "simple_test_case", - "description": "This test case contains a graph with client, firewall and server", - "policy_url_parameters": "?type=reachability&source=user1&destination=webserver", - "result": "SAT", - "graph": { - "nodes":[ - { - "name":"user1", - "functional_type":"endhost", - "neighbours":[ - { - "name":"nat" - } - ], - "configuration": - [ - { - "body": "cartoon", - "protocol": "HTTP_REQUEST", - "destination": "webserver" - } - ] - }, - { - "name":"nat", - "functional_type":"nat", - "neighbours":[ - { - "name":"dpi" - } - ], - "configuration":[ - "user1" - ] - }, - { - "name":"dpi", - "functional_type":"dpi", - "neighbours":[ - { - "name":"webserver" - } - ], - "configuration":[ - "sex", "droga" - ] - }, - { - "name":"webserver", - "functional_type":"webserver", - "neighbours":[ - - ] - } - ] - } + "id": 2, + "name": "simple_test_case", + "description": "This test case contains a graph with client, firewall and server", + "policy_url_parameters": [ + "?type=reachability&source=user1&destination=webserver" + ], + "results": [ + "SAT" + ], + "graph": { + "nodes": [ + { + "name": "user1", + "functional_type": "endhost", + "neighbours": [ + { + "name": "nat" + } + ], + "configuration": [ + { + "body": "cartoon", + "protocol": "HTTP_REQUEST", + "destination": "webserver" + } + ] + }, + { + "name": "nat", + "functional_type": "nat", + "neighbours": [ + { + "name": "dpi" + } + ], + "configuration": [ + "user1" + ] + }, + { + "name": "dpi", + "functional_type": "dpi", + "neighbours": [ + { + "name": "webserver" + } + ], + "configuration": [ + "sex", + "droga" + ] + }, + { + "name": "webserver", + "functional_type": "webserver", + "neighbours": [] + } + ] + } } \ No newline at end of file diff --git a/verigraph/tester/testcases/test_user_nat_dpi_webserver_trafficBlocked.json b/verigraph/tester/testcases/test_user_nat_dpi_webserver_trafficBlocked.json index 285ecf2..6cc5b22 100644 --- a/verigraph/tester/testcases/test_user_nat_dpi_webserver_trafficBlocked.json +++ b/verigraph/tester/testcases/test_user_nat_dpi_webserver_trafficBlocked.json @@ -1,59 +1,61 @@ { - "id": 1, - "name": "simple_test_case", - "description": "This test case contains a graph with client, firewall and server", - "policy_url_parameters": "?type=reachability&source=user1&destination=webserver", - "result": "UNSAT", - "graph": { - "nodes":[ - { - "name":"user1", - "functional_type":"endhost", - "neighbours":[ - { - "name":"nat" - } - ], - "configuration": - [ - { - "body": "sex", - "protocol": "HTTP_REQUEST", - "destination": "webserver" - } - ] - }, - { - "name":"nat", - "functional_type":"nat", - "neighbours":[ - { - "name":"dpi" - } - ], - "configuration":[ - "user1" - ] - }, - { - "name":"dpi", - "functional_type":"dpi", - "neighbours":[ - { - "name":"webserver" - } - ], - "configuration":[ - "sex", "droga" - ] - }, - { - "name":"webserver", - "functional_type":"webserver", - "neighbours":[ - - ] - } - ] - } + "id": 1, + "name": "simple_test_case", + "description": "This test case contains a graph with client, firewall and server", + "policy_url_parameters": [ + "?type=reachability&source=user1&destination=webserver" + ], + "results": [ + "UNSAT" + ], + "graph": { + "nodes": [ + { + "name": "user1", + "functional_type": "endhost", + "neighbours": [ + { + "name": "nat" + } + ], + "configuration": [ + { + "body": "sex", + "protocol": "HTTP_REQUEST", + "destination": "webserver" + } + ] + }, + { + "name": "nat", + "functional_type": "nat", + "neighbours": [ + { + "name": "dpi" + } + ], + "configuration": [ + "user1" + ] + }, + { + "name": "dpi", + "functional_type": "dpi", + "neighbours": [ + { + "name": "webserver" + } + ], + "configuration": [ + "sex", + "droga" + ] + }, + { + "name": "webserver", + "functional_type": "webserver", + "neighbours": [] + } + ] + } } \ No newline at end of file diff --git a/verigraph/tester/testcases/test_user_nat_vpn_fieldmod_webserver_unsat.json b/verigraph/tester/testcases/test_user_nat_vpn_fieldmod_webserver_unsat.json deleted file mode 100644 index 252e3b5..0000000 --- a/verigraph/tester/testcases/test_user_nat_vpn_fieldmod_webserver_unsat.json +++ /dev/null @@ -1,94 +0,0 @@ -{ - "id": 4, - "name": "nat_vpn_with_fieldmodifier_test_case", - "description": "This test case contains a graph with client, nat, vpn (with field mod in between) and server", - "policy_url_parameters": "?type=reachability&source=user1&destination=webserver", - "result": "UNSAT", - "graph": { - "nodes":[ - { - "name":"user1", - "functional_type":"endhost", - "neighbours":[ - { - "name":"nat" - } - ], - "configuration": - [ - { - "body": "cartoon", - "protocol": "HTTP_REQUEST", - "destination": "webserver" - } - ] - }, - { - "name":"nat", - "functional_type":"nat", - "neighbours":[ - { - "name":"user1" - }, - { - "name":"vpnaccess" - } - ], - "configuration":[ - "user1" - ] - }, - { - "name":"vpnaccess", - "functional_type":"vpnaccess", - "neighbours":[ - { - "name":"nat" - }, - { - "name":"fieldmodifier" - } - ], - "configuration":[ - {"vpnexit": "vpnexit"} - ] - }, - { - "name":"fieldmodifier", - "functional_type":"fieldmodifier", - "neighbours":[ - { - "name":"vpnaccess" - }, - { - "name":"vpnexit" - } - ] - }, - { - "name":"vpnexit", - "functional_type":"vpnexit", - "neighbours":[ - { - "name":"fieldmodifier" - }, - { - "name":"webserver" - } - ], - "configuration":[ - {"vpnaccess": "vpnaccess"} - ] - }, - { - "name":"webserver", - "functional_type":"webserver", - "neighbours":[ - { - "name": "vpnexit" - } - ] - } - ] - } -} \ No newline at end of file diff --git a/verigraph/tester/testcases/test_user_nat_vpn_webserver_sat.json b/verigraph/tester/testcases/test_user_nat_vpn_webserver_sat.json deleted file mode 100644 index 2ae31bc..0000000 --- a/verigraph/tester/testcases/test_user_nat_vpn_webserver_sat.json +++ /dev/null @@ -1,82 +0,0 @@ -{ - "id": 3, - "name": "nat_vpn_test_case", - "description": "This test case contains a graph with client, nat, vpn and server", - "policy_url_parameters": "?type=reachability&source=user1&destination=webserver", - "result": "SAT", - "graph": { - "nodes":[ - { - "name":"user1", - "functional_type":"endhost", - "neighbours":[ - { - "name":"nat" - } - ], - "configuration": - [ - { - "body": "cartoon", - "protocol": "HTTP_REQUEST", - "destination": "webserver" - } - ] - }, - { - "name":"nat", - "functional_type":"nat", - "neighbours":[ - { - "name":"user1" - }, - { - "name":"vpnaccess" - } - ], - "configuration":[ - "user1" - ] - }, - { - "name":"vpnaccess", - "functional_type":"vpnaccess", - "neighbours":[ - { - "name":"nat" - }, - { - "name":"vpnexit" - } - ], - "configuration":[ - {"vpnexit": "vpnexit"} - ] - }, - { - "name":"vpnexit", - "functional_type":"vpnexit", - "neighbours":[ - { - "name":"vpnaccess" - }, - { - "name":"webserver" - } - ], - "configuration":[ - {"vpnaccess": "vpnaccess"} - ] - }, - { - "name":"webserver", - "functional_type":"webserver", - "neighbours":[ - { - "name": "vpnexit" - } - ] - } - ] - } -} \ No newline at end of file diff --git a/verigraph/tester/testcases/test_webserver_vpn_nat_user_unsat.json b/verigraph/tester/testcases/test_webserver_vpn_nat_user_unsat.json deleted file mode 100644 index 60d09b3..0000000 --- a/verigraph/tester/testcases/test_webserver_vpn_nat_user_unsat.json +++ /dev/null @@ -1,82 +0,0 @@ -{ - "id": 5, - "name": "nat_vpn_test_case_serv_to_user", - "description": "This test case contains a graph with client, nat, vpn and server. webserver -> client", - "policy_url_parameters": "?type=reachability&source=webserver&destination=user1", - "result": "UNSAT", - "graph": { - "nodes":[ - { - "name":"user1", - "functional_type":"endhost", - "neighbours":[ - { - "name":"nat" - } - ], - "configuration": - [ - { - "body": "cartoon", - "protocol": "HTTP_REQUEST", - "destination": "webserver" - } - ] - }, - { - "name":"nat", - "functional_type":"nat", - "neighbours":[ - { - "name":"user1" - }, - { - "name":"vpnaccess" - } - ], - "configuration":[ - "user1" - ] - }, - { - "name":"vpnaccess", - "functional_type":"vpnaccess", - "neighbours":[ - { - "name":"nat" - }, - { - "name":"vpnexit" - } - ], - "configuration":[ - {"vpnexit": "vpnexit"} - ] - }, - { - "name":"vpnexit", - "functional_type":"vpnexit", - "neighbours":[ - { - "name":"vpnaccess" - }, - { - "name":"webserver" - } - ], - "configuration":[ - {"vpnaccess": "vpnaccess"} - ] - }, - { - "name":"webserver", - "functional_type":"webserver", - "neighbours":[ - { - "name": "vpnexit" - } - ] - } - ] - } -} \ No newline at end of file -- cgit 1.2.3-korg