Blame


1 3096da4e 2021-10-07 op # tests to run as a port of the regression suite. Leave empty to run
2 3096da4e 2021-10-07 op # all.
3 3096da4e 2021-10-07 op TESTS=
4 3096da4e 2021-10-07 op
5 4b93be28 2022-10-31 op DISTFILES = Makefile \
6 4b93be28 2022-10-31 op env \
7 4b93be28 2022-10-31 op err \
8 4b93be28 2022-10-31 op example.mime.types \
9 4b93be28 2022-10-31 op fcgi-test.c \
10 4b93be28 2022-10-31 op fill-file.c \
11 4b93be28 2022-10-31 op hello \
12 4b93be28 2022-10-31 op invalid \
13 4b93be28 2022-10-31 op iri_test.c \
14 4b93be28 2022-10-31 op lib.sh \
15 4b93be28 2022-10-31 op max-length-reply \
16 4b93be28 2022-10-31 op puny-test.c \
17 4b93be28 2022-10-31 op regress \
18 4b93be28 2022-10-31 op serve-bigfile \
19 4b93be28 2022-10-31 op sha \
20 4b93be28 2022-10-31 op slow \
21 4b93be28 2022-10-31 op tests.sh \
22 4b93be28 2022-10-31 op valid.ext
23 4b93be28 2022-10-31 op
24 5c2e310e 2021-01-22 op include ../Makefile.local
25 5c2e310e 2021-01-22 op
26 96e3c013 2022-07-04 op COMPAT= ${COBJS:%=../%}
27 96e3c013 2022-07-04 op
28 4b93be28 2022-10-31 op .PHONY: all data clean dist
29 5c2e310e 2021-01-22 op
30 a62c63f2 2021-12-29 op all: data puny-test iri_test fcgi-test
31 e5285d54 2021-12-09 op ./regress ${TESTS}
32 5c2e310e 2021-01-22 op
33 5741561d 2021-12-09 op data: testdata cert.pem testca.pem valid.crt invalid.cert.pem
34 0f2124e2 2021-06-12 op
35 4ad0601d 2021-02-10 op puny-test: puny-test.o ../puny.o ../utf8.o ../utils.o ../log.o ${COMPAT}
36 4ad0601d 2021-02-10 op ${CC} puny-test.o ../puny.o ../utf8.o ../utils.o ../log.o ${COMPAT} \
37 4ad0601d 2021-02-10 op -o puny-test ${LDFLAGS}
38 3300cbe0 2021-01-27 op
39 4ad0601d 2021-02-10 op iri_test: iri_test.o ../iri.o ../utf8.o ${COMPAT}
40 9797799a 2021-07-08 op ${CC} iri_test.o ../iri.o ../utf8.o ${COMPAT} -o $@ ${LDFLAGS}
41 5c2e310e 2021-01-22 op
42 609fc9f9 2021-01-22 op fill-file: fill-file.o
43 9797799a 2021-07-08 op ${CC} fill-file.o -o $@ ${LDFLAGS}
44 609fc9f9 2021-01-22 op
45 0f2124e2 2021-06-12 op fcgi-test: fcgi-test.o
46 0f2124e2 2021-06-12 op ${CC} fcgi-test.o ${COMPAT} -o fcgi-test ${LDFLAGS}
47 0f2124e2 2021-06-12 op
48 5c2e310e 2021-01-22 op key.pem: cert.pem
49 5c2e310e 2021-01-22 op
50 5c2e310e 2021-01-22 op # XXX: key size is NOT GOOD. This is only for testing. Smaller keys
51 5c2e310e 2021-01-22 op # are quicker to generate. DON'T DO THIS AT HOME.
52 5c2e310e 2021-01-22 op cert.pem:
53 7322a054 2021-07-03 op openssl req -x509 -newkey rsa:2048 \
54 7322a054 2021-07-03 op -keyout key.pem \
55 7322a054 2021-07-03 op -out cert.pem \
56 7322a054 2021-07-03 op -days 365 -nodes \
57 7322a054 2021-07-03 op -subj "/CN=localhost"
58 3e0164f4 2021-07-19 op ln -s cert.pem localhost.cert.pem
59 3e0164f4 2021-07-19 op ln -s key.pem localhost.key.pem
60 5c2e310e 2021-01-22 op @echo
61 5c2e310e 2021-01-22 op
62 02be96c6 2021-02-09 op testca.pem:
63 02be96c6 2021-02-09 op openssl genrsa -out testca.key 2048
64 7322a054 2021-07-03 op openssl req -x509 -new -sha256 \
65 7322a054 2021-07-03 op -key testca.key \
66 7322a054 2021-07-03 op -days 365 -nodes \
67 7322a054 2021-07-03 op -out testca.pem \
68 7322a054 2021-07-03 op -subj "/CN=testca"
69 02be96c6 2021-02-09 op @echo
70 02be96c6 2021-02-09 op
71 02be96c6 2021-02-09 op valid.crt: testca.pem
72 02be96c6 2021-02-09 op openssl genrsa -out valid.key 2048
73 7322a054 2021-07-03 op openssl req -new -key valid.key \
74 7322a054 2021-07-03 op -out valid.csr \
75 7322a054 2021-07-03 op -subj "/CN=valid"
76 02be96c6 2021-02-09 op @echo
77 02be96c6 2021-02-09 op openssl x509 -req -in valid.csr \
78 02be96c6 2021-02-09 op -CA testca.pem \
79 02be96c6 2021-02-09 op -CAkey testca.key \
80 02be96c6 2021-02-09 op -CAcreateserial \
81 02be96c6 2021-02-09 op -out valid.crt \
82 02be96c6 2021-02-09 op -days 365 \
83 02be96c6 2021-02-09 op -sha256 -extfile valid.ext
84 02be96c6 2021-02-09 op
85 02be96c6 2021-02-09 op invalid.cert.pem: cert.pem
86 02be96c6 2021-02-09 op cp cert.pem invalid.cert.pem
87 02be96c6 2021-02-09 op cp key.pem invalid.key.pem
88 02be96c6 2021-02-09 op
89 5c2e310e 2021-01-22 op clean:
90 5c2e310e 2021-01-22 op rm -f *.o iri_test cert.pem key.pem
91 3e0164f4 2021-07-19 op rm -f localhost.cert.pem localhost.key.pem
92 c2899486 2021-10-02 op rm -f testca.* valid.csr valid.key valid.crt invalid.*pem
93 a62c63f2 2021-12-29 op rm -rf testdata fill-file puny-test fcgi-test
94 176179b2 2021-10-04 op rm -f gmid.pid
95 5c2e310e 2021-01-22 op
96 609fc9f9 2021-01-22 op testdata: fill-file
97 5c2e310e 2021-01-22 op mkdir testdata
98 609fc9f9 2021-01-22 op ./fill-file testdata/bigfile
99 5c2e310e 2021-01-22 op ./sha testdata/bigfile testdata/bigfile.sha
100 5c2e310e 2021-01-22 op printf "# hello world\n" > testdata/index.gmi
101 5c2e310e 2021-01-22 op ./sha testdata/index.gmi testdata/index.gmi.sha
102 e3ddf390 2021-02-06 op cp hello slow err invalid serve-bigfile env testdata/
103 c836cdfa 2021-03-29 op cp max-length-reply testdata
104 5c2e310e 2021-01-22 op mkdir testdata/dir
105 475205fa 2022-07-04 op date > 'testdata/dir/current date'
106 c8b74339 2021-01-24 op cp hello testdata/dir
107 5c2e310e 2021-01-22 op cp testdata/index.gmi testdata/dir/foo.gmi
108 fb121226 2022-02-26 op touch testdata/test.m3u8 testdata/foo.1
109 4b93be28 2022-10-31 op
110 4b93be28 2022-10-31 op dist: ${DISTFILES}
111 4b93be28 2022-10-31 op mkdir -p ${DESTDIR}/
112 4b93be28 2022-10-31 op ${INSTALL} -m 0644 ${DISTFILES} ${DESTDIR}/
113 4b93be28 2022-10-31 op cd ${DESTDIR}/ && chmod +x env err hello invalid \
114 4b93be28 2022-10-31 op max-length-reply regress sha slow