Skip to content

Commit 3b14599

Browse files
committed
Update demo instructions
1 parent 8cbab0d commit 3b14599

File tree

4 files changed

+21
-12
lines changed

4 files changed

+21
-12
lines changed

README.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,24 @@ Our modified version of the wptserve HTTP server implementation can be found in
99
## Setup
1010
- Create a fresh Ubuntu22 container/VM: `lxc launch ubuntu:22.04 <name>` and connect to it `lxc exec <name> bash`
1111
- Switch to the ubuntu user: `su - ubuntu`
12-
- Clone this repository: `[email protected]:header-testing/header-testing.git`
12+
- Clone this repository: `git clone git@github.com:header-testing/header-testing.git`
1313
- Run the setup file: `cd header-testing/_hp`, `./setup.bash` (reopen all terminals or run `source ~/.bashrc` afterwards)
14-
- Configure DB settings in [config.json](_hp/config.json)
14+
- Configure DB settings in [config.json](_hp/tools/config.json); Make sure to create a database with the correct name
1515
- Setup the database: `cd _hp/tools && poetry run python models.py`
1616
- Setup certs: either remove `.demo` from the files in `_hp/tools/certs/` to use self-signed certs or add your own certs here
1717

1818
## Run Instructions
1919
- Always start the WPT server first (from the top-most folder): `poetry run -C _hp python wpt serve --config _hp/wpt-config.json`
20-
- Create the basic and parsing responses: Run `cd _hp/tools && poetry run create_responses.py` (basic), run `cd analysis` and execute `response_header_generation.ipynb` to generate the parsing responses.
20+
- Create the basic and parsing responses: Run `cd _hp/tools && poetry run python create_responses.py` (basic), run `cd analysis` and execute `response_header_generation.ipynb` to generate the parsing responses.
2121
- Manually check if the server and the tests are working: Visit http://sub.headers.websec.saarland:80/_hp/tests/framing.sub.html
2222
- Automatic testrunners:
2323
- `cd _hp/tools/crawler`
24-
- Android: `poetry run android_intent.py` (Additional config required)
25-
- MacOS/Ubuntu: `poetry run desktop_selenium.py`
26-
- iPadOS/iOS: `poetry run desktop_selenium.py ----gen_page_runner --page_runner_json urls.json --max_urls_until_restart 10000"`, then visit the URLs in that file manually
27-
- Analysis: Open `_hp/tools/analysis/main_analysis_desktop_basic+parsing.ipynb` (Also contains the mobile analysis)
24+
- Android: `poetry run python android_intent.py` (Additional config required)
25+
- MacOS/Ubuntu: `poetry run python desktop_selenium.py` (For a quick test run: `poetry run python desktop_selenium.py --debug_browsers --resp_type debug --ignore_certs`)
26+
- iPadOS/iOS: `poetry run python desktop_selenium.py ----gen_page_runner --page_runner_json urls.json --max_urls_until_restart 10000"`, then visit the URLs in that file manually
27+
- Analysis:
28+
- Run `cd _hp/tools/analysis && poetry run jupyter-lab`
29+
- Open `_hp/tools/analysis/main_analysis_desktop_basic+parsing.ipynb` (Also contains the mobile analysis)
2830

2931
## Inventory
3032
- `_hp/`: All test and analysis code for the paper:

_hp/tools/analysis/utils.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88

99
@dataclass
1010
class Config:
11-
DB_HOST: str="134.96.225.205"
12-
DB_NAME: str="http_header"
13-
DB_USER: str="http_header"
14-
DB_PASSWORD: str="bde50f42d5851a9eb6bf4166e737cb1c"
11+
DB_HOST: str="localhost"
12+
DB_NAME: str="http_header_demo"
13+
DB_USER: str=""
14+
DB_PASSWORD: str=""
1515
DB_PORT: str="5432"
1616

1717
def get_data(config: Config, select_query: str, quiet=False) -> pd.DataFrame:

_hp/tools/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"DB_URL": "postgresql+psycopg2://http_header:[email protected]:5432/http_header"
2+
"DB_URL": "postgresql+psycopg2://localhost:5432/http_header_demo"
33
}

_hp/tools/crawler/desktop_selenium.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,8 @@ def unraisable_hook(unraisable):
274274
help="Toggle on debugging for browser selection")
275275
parser.add_argument("--debug_input", action="store_true",
276276
help="Toggle on debugging for input(Next) during the run.")
277+
parser.add_argument("--ignore_certs", action="store_true",
278+
help="Ignore certificate errors (necessary for local/debug run)")
277279
parser.add_argument("--run_mode", choices=["run_all", "repeat"], default="run_all",
278280
help="Specify the mode (default: run_all)")
279281
parser.add_argument("--num_browsers", default=60, type=int, help="How many browsers to start in parallel (max).")
@@ -371,13 +373,18 @@ def unraisable_hook(unraisable):
371373
all_args = []
372374
assert(len(config) == 1)
373375
browser_name, browser_version, binary_location, arguments, browser_id = config[0]
376+
if args.ignore_certs:
377+
arguments = arguments + ["--ignore-certificate-errors"]
374378
for url in urls:
375379
assert(int(re.findall("runner-(\d+)", url)[0]) == 1)
376380
url = url + f"?browser_id={browser_id}"
377381
all_args.append((log_path, browser_name, browser_version, binary_location, arguments, args.debug_input, [url], args.timeout_task, args.timeout_task-60))
378382
else:
379383
for scheme in ["http", "https"]:
380384
for browser_name, browser_version, binary_location, arguments, browser_id in config:
385+
if args.ignore_certs:
386+
arguments = arguments + ["--ignore-certificate-errors"]
387+
381388
if args.run_mode == "run_all":
382389
test_urls = get_tests(resp_type=args.resp_type, browser_id=browser_id, scheme=scheme, max_resps=args.max_resps, max_popups=args.max_popups)
383390
page_timeout = TIMEOUT

0 commit comments

Comments
 (0)