Compare commits
No commits in common. "c8" and "c8s" have entirely different histories.
2
.gitignore
vendored
2
.gitignore
vendored
@ -1 +1 @@
|
|||||||
SOURCES/nghttp2-1.33.0.tar.xz
|
/nghttp2-[0-9]*.tar.xz
|
||||||
|
@ -1 +0,0 @@
|
|||||||
0a11f7de6ea8e66fbecc9fe4ddc61b6ab40af469 SOURCES/nghttp2-1.33.0.tar.xz
|
|
6
gating.yaml
Normal file
6
gating.yaml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
--- !Policy
|
||||||
|
product_versions:
|
||||||
|
- rhel-8
|
||||||
|
decision_context: osci_compose_gate
|
||||||
|
rules:
|
||||||
|
- !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional}
|
1
sources
Normal file
1
sources
Normal file
@ -0,0 +1 @@
|
|||||||
|
SHA512 (nghttp2-1.33.0.tar.xz) = eeb0bf64fea115444c685c8a01c1017ce96be18adf88ffcdecad067de7012ca61c6b2b6a627b18e2572bba7bd77ec56a3ca4b1109f7a4b21220e8e28687b5b74
|
69
tests/client-server/runtest.sh
Executable file
69
tests/client-server/runtest.sh
Executable file
@ -0,0 +1,69 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# exit immediately if any command returns non-zero exit code
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# print commands as they are executed by the shell interpreter
|
||||||
|
set -x
|
||||||
|
|
||||||
|
# global constants
|
||||||
|
HOST="localhost"
|
||||||
|
PORT="1234"
|
||||||
|
PKEY="./pkey.pem"
|
||||||
|
CERT="./cert.pem"
|
||||||
|
CURL_OUT="./curl.out"
|
||||||
|
CURL_ERR="./curl.err"
|
||||||
|
NGHTTP_OUT="./nghttp.out"
|
||||||
|
NGHTTP_ERR="./nghttp.err"
|
||||||
|
SELF="./runtest.sh"
|
||||||
|
URL="https://${HOST}:${PORT}/${SELF}"
|
||||||
|
|
||||||
|
# print versions of related pkgs
|
||||||
|
PKGS="$(set +x; eval echo {lib,}curl {lib,}nghttp2 openssl{,-libs})"
|
||||||
|
rpm -q $PKGS | sort -V
|
||||||
|
rpm -V $PKGS
|
||||||
|
|
||||||
|
# print full path of used commands
|
||||||
|
(set +x
|
||||||
|
for i in curl nghttp{,d} openssl; do
|
||||||
|
(set -x; command -v $i)
|
||||||
|
done
|
||||||
|
)
|
||||||
|
|
||||||
|
# make sure that $SELF exists
|
||||||
|
pwd
|
||||||
|
file -E $SELF
|
||||||
|
|
||||||
|
# create a self-signed certificate
|
||||||
|
openssl req -x509 -newkey rsa:4096 -sha256 -days 3650 \
|
||||||
|
-subj /CN=${HOST} -addext subjectAltName=DNS:${HOST} \
|
||||||
|
-nodes -keyout $PKEY -out $CERT
|
||||||
|
|
||||||
|
# run nghttpd in the background
|
||||||
|
nghttpd -d "$PWD" $PORT $PKEY $CERT &
|
||||||
|
NGHTTPD_PID=$!
|
||||||
|
|
||||||
|
# FIXME: wait for open port instead
|
||||||
|
sleep 2
|
||||||
|
|
||||||
|
# transfer the contents of this script over HTTP/2 using curl
|
||||||
|
curl --cacert $CERT --fail --silent --verbose $URL \
|
||||||
|
> $CURL_OUT 2> $CURL_ERR
|
||||||
|
|
||||||
|
# check whether the received data matches the original contents
|
||||||
|
diff $SELF $CURL_OUT
|
||||||
|
|
||||||
|
# check that we made a successful HTTP/2 request with curl
|
||||||
|
grep '^< HTTP/2 200' $CURL_ERR
|
||||||
|
|
||||||
|
# transfer the contents of this script over HTTP/2 using nghttp
|
||||||
|
nghttp $URL > $NGHTTP_OUT
|
||||||
|
|
||||||
|
# check whether the received data matches the original contents
|
||||||
|
diff $SELF $NGHTTP_OUT
|
||||||
|
|
||||||
|
# kill nghttpd running in the background
|
||||||
|
kill $NGHTTPD_PID
|
||||||
|
|
||||||
|
# wait till the background process finishes
|
||||||
|
wait
|
13
tests/tests.yml
Normal file
13
tests/tests.yml
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
- hosts: localhost
|
||||||
|
roles:
|
||||||
|
- role: standard-test-basic
|
||||||
|
tags:
|
||||||
|
- classic
|
||||||
|
tests:
|
||||||
|
- client-server:
|
||||||
|
dir: client-server
|
||||||
|
run: ./runtest.sh
|
||||||
|
required_packages:
|
||||||
|
- curl
|
||||||
|
- nghttp2
|
||||||
|
- openssl
|
Loading…
Reference in New Issue
Block a user