diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 19 |
1 files changed, 17 insertions, 2 deletions
@@ -78,7 +78,18 @@ $(TESTENV_GPIO): test -c $(TESTENV_GPIO) -run: testenv $(TESTENV_GPIO) +run: testenv testenv-ssl $(TESTENV_GPIO) + test -d testenv/.ssl || docker run --rm \ + --volume `pwd`:/src:ro \ + --volume `pwd`/testenv:/src/testenv:rw \ + -t $(TESTENV_IMAGE) bash -c " \ + groupadd kvmd-nginx \ + && /src/scripts/kvmd-gencert --do-the-thing \ + && chown -R root:root /etc/kvmd/nginx/ssl \ + && chmod 664 /etc/kvmd/nginx/ssl/* \ + && chmod 775 /etc/kvmd/nginx/ssl \ + && mv /etc/kvmd/nginx/ssl /src/testenv/.ssl \ + " - docker run --rm --name kvmd \ --cap-add SYS_ADMIN \ --volume `pwd`/testenv/run:/run/kvmd:rw \ @@ -95,11 +106,15 @@ run: testenv $(TESTENV_GPIO) --env KVMD_PROCFS_PREFIX=/fake_procfs \ $(if $(TESTENV_RELAY),--device $(TESTENV_RELAY):$(TESTENV_RELAY),) \ --publish 8080:80/tcp \ + --publish 4430:443/tcp \ -it $(TESTENV_IMAGE) /bin/bash -c " \ mount -t debugfs none /sys/kernel/debug \ && test -d /sys/kernel/debug/gpio-mockup/`basename $(TESTENV_GPIO)`/ \ && (socat PTY,link=$(TESTENV_HID) PTY,link=/dev/ttyS11 &) \ && cp -r /usr/share/kvmd/configs.default/nginx/* /etc/kvmd/nginx \ + && sed -i '$$ s/.$$//' /etc/kvmd/nginx/nginx.conf \ + && cat testenv/nginx.append.conf >> /etc/kvmd/nginx/nginx.conf \ + && cp -a /testenv/.ssl /etc/kvmd/nginx/ssl \ && cp /usr/share/kvmd/configs.default/kvmd/*.yaml /etc/kvmd \ && cp /usr/share/kvmd/configs.default/kvmd/*passwd /etc/kvmd \ && cp /usr/share/kvmd/configs.default/kvmd/main/$(if $(P),$(P),$(DEFAULT_PLATFORM)).yaml /etc/kvmd/main.yaml \ @@ -216,7 +231,7 @@ clean: clean-all: testenv clean - docker run --rm \ --volume `pwd`:/src \ - -it $(TESTENV_IMAGE) bash -c "cd src && rm -rf testenv/{.tox,.mypy_cache,.coverage}" + -it $(TESTENV_IMAGE) bash -c "cd src && rm -rf testenv/{.ssl,.tox,.mypy_cache,.coverage}" .PHONY: testenv |