Skip to content

Commit

Permalink
Run testing also for HTTPS.
Browse files Browse the repository at this point in the history
  • Loading branch information
fukamachi committed Aug 11, 2024
1 parent 438e2e9 commit 621ab7c
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ jobs:
- uses: actions/checkout@v4
- name: Install dependencies from APT
run: sudo apt-get install -y libev-dev gcc libc6-dev
- name: Generate server certificates
run: sh ./t/generate-certificates.sh
- name: Install Roswell
env:
LISP: ${{ matrix.lisp }}
Expand All @@ -24,6 +26,8 @@ jobs:
run: ros -e '(ql-dist:install-dist "http://dist.ultralisp.org/" :prompt nil)'
- name: Install Rove
run: ros install rove
- name: Install the latest Clack (for HTTPS testing with clack-test)
run: ros install fukamachi/clack
- name: Run tests
env:
LISP: ${{ matrix.lisp }}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ benchmark/benchmark.log
.qlot/
qlfile
qlfile.lock
t/certs/
15 changes: 15 additions & 0 deletions t/generate-certificates.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/sh

mkdir t/certs
cd t/certs

openssl genrsa -out localCA.key 2048
openssl req -batch -new -key localCA.key -out localCA.csr \
-subj "/C=JP/ST=Tokyo/L=Chuo-ku/O=\"Woo\"/OU=Development/CN=localhost"
openssl x509 -req -days 3650 -signkey localCA.key -in localCA.csr -out localCA.crt
openssl x509 -text -noout -in localCA.crt
openssl genrsa -out localhost.key 2048
openssl req -batch -new -key localhost.key -out localhost.csr \
-subj "/C=JP/ST=Tokyo/L=Chuo-ku/O=\"Woo\"/OU=Development/CN=localhost"
echo 'subjectAltName = DNS:localhost, DNS:localhost.localdomain, IP:127.0.0.1, DNS:app, DNS:app.localdomain' > localhost.csx
openssl x509 -req -days 1825 -CA localCA.crt -CAkey localCA.key -CAcreateserial -in localhost.csr -extfile localhost.csx -out localhost.crt
8 changes: 8 additions & 0 deletions t/woo.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,11 @@

(deftest woo-server-tests
(clack.test.suite:run-server-tests :woo))

(deftest woo-ssl-server-tests
(let ((clack.test:*clackup-additional-args*
'(:ssl-cert-file #P"t/certs/localhost.crt"
:ssl-key-file #P"t/certs/localhost.key"))
(dex:*not-verify-ssl* t)
(clack.test:*use-https* t))
(clack.test.suite:run-server-tests :woo)))

0 comments on commit 621ab7c

Please sign in to comment.