git » chasquid » commit 0414af0

test: Avoid file with ':' in the name

author Alberto Bertogli
2024-04-27 15:40:37 UTC
committer Alberto Bertogli
2024-04-27 15:55:07 UTC
parent 7dbde5a6949da1f52b3d89af60de9d1e350c5b69

test: Avoid file with ':' in the name

Unfortunately, `go get` rejects repos that have files with ':':
https://github.com/golang/go/issues/28001.

We have one such file in the tests.

This prevents some of the Go tooling from working on the latest release,
including pkg.go.dev.

So, as a workaround we use a compatible file name in the repository, and
rename it when running the test. This is very hacky, but it's okay for a
single test.

test/t-20-bad_configs/c-11-bad_dkim_key/domains/testserver/{dkim:selector.pem => dkim__selector.pem} +0 -0
test/t-20-bad_configs/run.sh +6 -0

diff --git a/test/t-20-bad_configs/c-11-bad_dkim_key/domains/testserver/dkim:selector.pem b/test/t-20-bad_configs/c-11-bad_dkim_key/domains/testserver/dkim__selector.pem
similarity index 100%
rename from test/t-20-bad_configs/c-11-bad_dkim_key/domains/testserver/dkim:selector.pem
rename to test/t-20-bad_configs/c-11-bad_dkim_key/domains/testserver/dkim__selector.pem
diff --git a/test/t-20-bad_configs/run.sh b/test/t-20-bad_configs/run.sh
index 870f033..b3bbb3c 100755
--- a/test/t-20-bad_configs/run.sh
+++ b/test/t-20-bad_configs/run.sh
@@ -24,6 +24,12 @@ do
 	CONFDIR=$i/ generate_certs_for testserver
 done
 
+# Adjust the name of the dkim key file in c-11-bad_dkim_key.
+# `go get` rejects repos that have files with ':', so as a workaround we store
+# a compatible file name in the repo, and copy it before testing.
+cp c-11-bad_dkim_key/domains/testserver/dkim__selector.pem \
+	c-11-bad_dkim_key/domains/testserver/dkim:selector.pem
+
 for i in c-*; do
 	if chasquid --config_dir="$i" > ".chasquid-$i.out" 2>&1; then
 		echo "$i failed; output:"