diff --git a/.github/actions/smoketest/action.yaml b/.github/actions/smoketest/action.yaml index cf157ae3..3328a977 100644 --- a/.github/actions/smoketest/action.yaml +++ b/.github/actions/smoketest/action.yaml @@ -11,42 +11,11 @@ runs: touch /tmp/camblet.log /tmp/file-server.log /tmp/python.log echo "Run processes" sudo AGENT_METADATACOLLECTORS_DOCKER_ENABLED=true camblet agent > /tmp/camblet.log & - go build test/file-server.go - ./file-server >/tmp/file-server.log & - docker run -d --rm -p 8080:80 nginx - sleep 2 - echo "Test downloading a bigger file" - head -c 2M bigfile.o - curl -v -o /tmp/bigfile_downloaded.o http://localhost:8000/bigfile.o + ./test/smoke.sh - echo "Test uploading this file" - curl -v -F "bigfile_downloaded.o=@/tmp/bigfile_downloaded.o" http://localhost:8000/upload - diff bigfile.o bigfile_downloaded.o - - echo "Test bearssl with non-bearssl compatibility" - python3 -m http.server 7000 >/tmp/python.log & - sleep 1 - echo "testing with curl..." - curl -k -v https://localhost:7000/ - echo "testing with wget..." - wget --no-check-certificate https://localhost:7000/ - - echo "Test openssl client connect to python with default cipher" - openssl s_client -connect 127.0.0.1:7000 - echo "Test openssl client connect to python with ECDHE-RSA-CHACHA20-POLY1305 cipher" - openssl s_client -cipher ECDHE-RSA-CHACHA20-POLY1305 -connect 127.0.0.1:7000 - - echo "Test sendfile with NGiNX using curl" - curl -v http://localhost:8080 - - echo "Test sendfile with NGiNX using wget" - wget -v http://localhost:8000 - - echo "Stop processes" - sudo kill -9 $(jobs -p) + echo "Stop camblet" sudo pkill -9 camblet - docker kill $(docker ps -q) - name: Kernel log if: always() diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index abf53bda..abde0e91 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -70,7 +70,7 @@ jobs: working-directory: camblet-driver run: | sudo modprobe tls - sudo modprobe camblet ktls_available=1 + sudo modprobe camblet dyndbg==_ ktls_available=1 sudo dmesg -T # - name: Setup upterm session @@ -91,7 +91,7 @@ jobs: working-directory: camblet-driver run: | sudo rmmod tls - sudo modprobe camblet ktls_available=0 + sudo modprobe camblet dyndbg==_ ktls_available=0 sudo dmesg -T - name: Run proxy-wasm smoke test with bearSSL diff --git a/test/smoke.sh b/test/smoke.sh new file mode 100755 index 00000000..16657f49 --- /dev/null +++ b/test/smoke.sh @@ -0,0 +1,55 @@ +#!/bin/bash + +set -euo pipefail + +echo "Building file server" +go build test/file-server.go + +echo "Starting file server" +./file-server >/tmp/file-server.log 2>&1 & + +echo "Starting NGiNX in docker" +sudo docker run -d --rm -p 8080:80 nginx + +sleep 2 + +echo "Test downloading a bigger file" +head -c 2M bigfile.o +curl -v -o /tmp/bigfile_downloaded.o http://localhost:8000/bigfile.o + +echo "Test uploading this file" +curl -v -F "bigfile_downloaded.o=@/tmp/bigfile_downloaded.o" http://localhost:8000/upload +diff bigfile.o bigfile_downloaded.o + +echo "Test bearssl with non-bearssl compatibility" +python3 -m http.server 7000 >/tmp/python.log & +sleep 1 +echo "testing with curl..." +curl -k -v https://localhost:7000/ +echo "testing with wget..." +wget --no-check-certificate https://localhost:7000/ + +echo "Test openssl client connect to python with default cipher" +echo -e "GET / HTTP/1.1\r\n\r\n" | openssl s_client -connect 127.0.0.1:7000 +echo "Test openssl client connect to python with ECDHE-RSA-CHACHA20-POLY1305 cipher" +echo -e "GET / HTTP/1.1\r\n\r\n" | openssl s_client -cipher ECDHE-RSA-CHACHA20-POLY1305 -connect 127.0.0.1:7000 + +# turn off because of know issue +# echo "Test file-server using curl" +# rm -f testfile test.output +# echo "response" > testfile +# echo -e " 100 0\n 100 response" > test.output +# for i in `seq 1 100`; do curl -s localhost:8000/testfile; echo $?; done |sort|uniq -c|diff - test.output + +echo "Test sendfile with NGiNX using curl" +echo -e " 100 0" > test.output +for i in `seq 1 100`; do curl -s -o/dev/null localhost:8080; echo $?; done |sort|uniq -c|diff - test.output + +echo "Test sendfile with NGiNX using wget" +echo -e " 100 0" > test.output +for i in `seq 1 100`; do wget -q -O/dev/null localhost:8080; echo $?; done |sort|uniq -c|diff - test.output + +echo "Stop processes" +sudo pkill python3 +sudo pkill file-server +sudo docker kill $(sudo docker ps -q)