diff --git a/scripts/testing/gateway-responses/test-bad-gzip.py b/scripts/testing/gateway-responses/test-bad-gzip.py deleted file mode 100644 index 9d50f1f..0000000 --- a/scripts/testing/gateway-responses/test-bad-gzip.py +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env python3 -# -# 2022-01-10: THIS SCRIPT DOES NOT PERFORM THE INTENDED PURPOSE -# BECAUSE IT SEEMS THAT `requests` (or underlying modules) IS TOO CLEVER -# AND APPLIES COMPRESSION WHEN WE SET THE `Content-Encoding: gzip` -# HEADER - -import json -import requests -import sys - -print(''' -DO NOT USE THIS SCRIPT, IT DOES NOT PERFORM THE INTENDED PURPOSE. - -USE THE `test-bad-gzip.sh` SCRIPT INSTEAD. - -''') -sys.exit(-1) - -if len(sys.argv) != 2: - print('test-sender.py ') - sys.exit(-1) - -with open(sys.argv[1], 'r') as f: - msg = f.read() - - s = requests.Session() - - # This apparently causes compression to actually happen - s.headers['Content-Encoding'] = 'gzip' - r = s.post( - 'https://dev.eddn.edcd.io:4432/upload/', - data=msg, - ) - - print(f'Response: {r!r}') - print(f'Body: {r.content.decode()}') - diff --git a/scripts/testing/gateway-responses/test-bad-gzip.sh b/scripts/testing/gateway-responses/test-bad-gzip.sh deleted file mode 100644 index 77592bf..0000000 --- a/scripts/testing/gateway-responses/test-bad-gzip.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh -# -# python `requests` appears to perform compression when you set the -# 'Content-Encoding: gzip' header, so do this with curl. - -curl --verbose -d 'wegiuweuygtfawgep9aqe8fpq2387lfbr;iufvypq38764tpgf' -H 'Content-Encoding: gzip' 'https://dev.eddn.edcd.io:4432/upload/' diff --git a/scripts/testing/gateway-responses/test-gzip-bad-formdata.py b/scripts/testing/gateway-responses/test-gzip-bad-formdata.py deleted file mode 100644 index 0e3e1f0..0000000 --- a/scripts/testing/gateway-responses/test-gzip-bad-formdata.py +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/env python3 - -import json -import requests -import sys -import urllib3 -import zlib - -if len(sys.argv) != 2: - print('test-sender.py ') - sys.exit(-1) - -with open(sys.argv[1], 'r') as f: - # Read from provided file - msg = f.read() - - # Fake form-encode it - msg = 'wibble=' + msg - - # Compress it - msg_gzip = zlib.compress(msg.encode('utf-8')) - - http = urllib3.PoolManager() - - # Send that compressed data as a POST body - r = http.request( - 'POST', - 'https://dev.eddn.edcd.io:4432/upload/', - headers={ - 'Content-Encoding': 'gzip' - }, - body=msg_gzip - ) - - print(f'Response: {r.status!r}') - print(f'Body:\n{r.data.decode()}\n') - diff --git a/scripts/testing/gateway-responses/test-gzip-correct-formdata.py b/scripts/testing/gateway-responses/test-gzip-correct-formdata.py deleted file mode 100644 index e58c1d9..0000000 --- a/scripts/testing/gateway-responses/test-gzip-correct-formdata.py +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/env python3 - -import json -import requests -import sys -import urllib3 -import zlib - -if len(sys.argv) != 2: - print('test-sender.py ') - sys.exit(-1) - -with open(sys.argv[1], 'r') as f: - # Read from provided file - msg = f.read() - - # Fake form-encode it - msg = 'data=' + msg - - # Compress it - msg_gzip = zlib.compress(msg.encode('utf-8')) - - http = urllib3.PoolManager() - - # Send that compressed data as a POST body - r = http.request( - 'POST', - 'https://dev.eddn.edcd.io:4432/upload/', - headers={ - 'Content-Encoding': 'gzip' - }, - body=msg_gzip - ) - - print(f'Response: {r.status!r}') - print(f'Body:\n{r.data.decode()}\n') - diff --git a/scripts/testing/gateway-responses/test-gzip-plain-json.py b/scripts/testing/gateway-responses/test-gzip-plain-json.py deleted file mode 100644 index db7042a..0000000 --- a/scripts/testing/gateway-responses/test-gzip-plain-json.py +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env python3 - -import json -import requests -import sys -import urllib3 -import zlib - -if len(sys.argv) != 2: - print('test-sender.py ') - sys.exit(-1) - -with open(sys.argv[1], 'r') as f: - # Read from provided file - msg = f.read() - - # Compress it - msg_gzip = zlib.compress(msg.encode('utf-8')) - - http = urllib3.PoolManager() - - # Send that compressed data as a POST body - r = http.request( - 'POST', - 'https://dev.eddn.edcd.io:4432/upload/', - headers={ - 'Content-Encoding': 'gzip' - }, - body=msg_gzip - ) - - print(f'Response: {r.status!r}') - print(f'Body:\n{r.data.decode()}\n') - diff --git a/scripts/testing/gateway-responses/test-plain-bad-formdata.py b/scripts/testing/gateway-responses/test-plain-bad-formdata.py deleted file mode 100644 index 04cc0bd..0000000 --- a/scripts/testing/gateway-responses/test-plain-bad-formdata.py +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env python3 - -import json -import sys -import urllib3 - -if len(sys.argv) != 2: - print('test-sender.py ') - sys.exit(-1) - -with open(sys.argv[1], 'r') as f: - # Read from provided file - msg = f.read() - - # Fake form-encode it - msg = 'wibble=' + msg - - http = urllib3.PoolManager() - - # Send that data as a POST body - r = http.request( - 'POST', - 'https://dev.eddn.edcd.io:4432/upload/', - body=msg - ) - - print(f'Response: {r.status!r}') - print(f'Body:\n{r.data.decode()}\n') - diff --git a/scripts/testing/gateway-responses/test-plain-correct-formdata.py b/scripts/testing/gateway-responses/test-plain-correct-formdata.py deleted file mode 100644 index a00815f..0000000 --- a/scripts/testing/gateway-responses/test-plain-correct-formdata.py +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env python3 - -import json -import sys -import urllib3 - -if len(sys.argv) != 2: - print('test-sender.py ') - sys.exit(-1) - -with open(sys.argv[1], 'r') as f: - # Read from provided file - msg = f.read() - - # Fake form-encode it - msg = 'data=' + msg - - http = urllib3.PoolManager() - - # Send that data as a POST body - r = http.request( - 'POST', - 'https://dev.eddn.edcd.io:4432/upload/', - body=msg - ) - - print(f'Response: {r.status!r}') - print(f'Body:\n{r.data.decode()}\n') -