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