Fix tests

This commit is contained in:
erik 2022-10-21 11:57:44 +02:00
parent b3044fbc5c
commit 9519e83497
2 changed files with 8 additions and 16 deletions

View file

@ -82,7 +82,7 @@ data:
listen 443 ssl; listen 443 ssl;
ssl_certificate /etc/certs/tls.crt; ssl_certificate /etc/certs/tls.crt;
ssl_certificate_key /etc/certs/tls.key; ssl_certificate_key /etc/certs/tls.key;
server_name FQDN server_name FQDN
add_header Strict-Transport-Security 'max-age=31536000; includeSubDomains; preload'; add_header Strict-Transport-Security 'max-age=31536000; includeSubDomains; preload';
add_header X-XSS-Protection "1; mode=block"; add_header X-XSS-Protection "1; mode=block";
add_header X-Frame-Options "SAMEORIGIN"; add_header X-Frame-Options "SAMEORIGIN";

View file

@ -42,21 +42,13 @@
:gitea-repo "repo" :gitea-repo "repo"
:branchname "main"}]})))) :branchname "main"}]}))))
(deftest should-generate-nginx-configmap (deftest should-generate-nginx-configmap-website-conf
(is (= {:website.conf-c1 "server {\n listen 80 default_server;\n listen [::]:80 default_server;\n listen 443 ssl;\n ssl_certificate /etc/certs/tls.crt;\n ssl_certificate_key /etc/certs/tls.key;\n server_name test.de www.test.de test-it.de www.test-it.de; \n add_header Strict-Transport-Security 'max-age=31536000; includeSubDomains; preload';\n add_header X-XSS-Protection \"1; mode=block\";\n add_header X-Frame-Options \"SAMEORIGIN\";\n add_header X-Content-Type-Options nosniff;\n add_header Referrer-Policy \"strict-origin\";\n # add_header Permissions-Policy \"permissions here\";\n root /var/www/html/website/;\n index index.html;\n location / {\n try_files $uri $uri/ /index.html =404;\n }\n}\n", (is (= "server {\n listen 80 default_server;\n listen [::]:80 default_server;\n listen 443 ssl;\n ssl_certificate /etc/certs/tls.crt;\n ssl_certificate_key /etc/certs/tls.key;\n server_name test.de www.test.de test-it.de www.test-it.de;\n add_header Strict-Transport-Security 'max-age=31536000; includeSubDomains; preload';\n add_header X-XSS-Protection \"1; mode=block\";\n add_header X-Frame-Options \"SAMEORIGIN\";\n add_header X-Content-Type-Options nosniff;\n add_header Referrer-Policy \"strict-origin\";\n # add_header Permissions-Policy \"permissions here\";\n root /var/www/html/website/;\n index index.html;\n location / {\n try_files $uri $uri/ /index.html =404;\n }\n}\n"
:website.conf-c2 "server {\n listen 80 default_server;\n listen [::]:80 default_server;\n listen 443 ssl;\n ssl_certificate /etc/certs/tls.crt;\n ssl_certificate_key /etc/certs/tls.key;\n server_name example.de www.example.de example-by.de www.example-by.de; \n add_header Strict-Transport-Security 'max-age=31536000; includeSubDomains; preload';\n add_header X-XSS-Protection \"1; mode=block\";\n add_header X-Frame-Options \"SAMEORIGIN\";\n add_header X-Content-Type-Options nosniff;\n add_header Referrer-Policy \"strict-origin\";\n # add_header Permissions-Policy \"permissions here\";\n root /var/www/html/website/;\n index index.html;\n location / {\n try_files $uri $uri/ /index.html =404;\n }\n}\n", (:website.conf (:data (cut/generate-nginx-configmap {:unique-name "test.io",
:name-c1 "test-io-configmap", :gitea-host "gitea.evilorg",
:name-c2 "example-io-configmap"} :gitea-repo "none",
(th/map-diff (cut/generate-nginx-configmap {:unique-name "test.io", :branchname "mablain",
:gitea-host "gitea.evilorg", :fqdns ["test.de" "www.test.de" "test-it.de" "www.test-it.de"]}))))))
:gitea-repo "none",
:branchname "mablain",
:fqdns ["test.de" "www.test.de" "test-it.de" "www.test-it.de"]})
(cut/generate-nginx-configmap {:unique-name "example.io",
:gitea-host "gitea.evilorg",
:gitea-repo "none",
:branchname "mablain",
:fqdns ["example.de" "www.example.de" "example-by.de" "www.example-by.de"]})))))
(deftest should-generate-nginx-deployment (deftest should-generate-nginx-deployment
(is (= {:apiVersion "apps/v1", (is (= {:apiVersion "apps/v1",