Skip to content

Commit

Permalink
add test for tls
Browse files Browse the repository at this point in the history
  • Loading branch information
Mic92 authored and mergify[bot] committed Jul 25, 2024
1 parent a73e36e commit 316a042
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 0 deletions.
1 change: 1 addition & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
t01-signing = import ./tests/t01-signing.nix testArgs;
t02-varnish = import ./tests/t02-varnish.nix testArgs;
t03-chroot = import ./tests/t03-chroot.nix testArgs;
t04-tls = import ./tests/t04-tls.nix testArgs;
} // {
clippy = config.packages.harmonia.override ({
enableClippy = true;
Expand Down
15 changes: 15 additions & 0 deletions tests/t04-tls.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
(import ./lib.nix) {
name = "t04-tls";

nodes.harmonia = {
imports = [ ../module.nix ];

services.harmonia-dev.enable = true;
services.harmonia-dev.settings.tls_cert_path = ./tls-cert.pem;
services.harmonia-dev.settings.tls_key_path = ./tls-key.pem;
};

testScript = ''
harmonia.wait_until_succeeds("curl --cacert ${./tls-cert.pem} https://localhost:5000/version")
'';
}
20 changes: 20 additions & 0 deletions tests/tls-cert.pem
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
-----BEGIN CERTIFICATE-----
MIIDOTCCAiECFAc5lyBrKjhrcgYBeGP7LA7nGzQiMA0GCSqGSIb3DQEBCwUAMFkx
CzAJBgNVBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRl
cm5ldCBXaWRnaXRzIFB0eSBMdGQxEjAQBgNVBAMMCWxvY2FsaG9zdDAeFw0yNDA3
MjUxMjQ3MTNaFw0yNTA3MjUxMjQ3MTNaMFkxCzAJBgNVBAYTAkFVMRMwEQYDVQQI
DApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQx
EjAQBgNVBAMMCWxvY2FsaG9zdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
ggEBAKB6EDoExUqUIX5ANiA2VRNS6Q5otiecHpg7aL/0fkXKUm/iqmvLdib6AlrB
GDo0GHNfKrJatSFTDtaaVh6RgwoWFxZbml46NdMfzNy7h2E2YEtyuHO7bpuh+vKC
73jK9Z9estGkg2xYrgubGcaiZGO5KF97MGrB6mf3xM214SJDU+0znvH7Xbtwkl8D
kOjf7WmuWopBKCeoj/x1CFURHF1rr2fPaOh01qnRDCZQDpeKv41K0EFbTue7yKtj
Y54/y0rY1rdrNA/DU2MhHNxy/CjvO+tkliM9gieD4S6J60lIDSrp5UW6shPLXX2C
GAC1fKZTNNWOVgWi/pfZVXTaTCUCAwEAATANBgkqhkiG9w0BAQsFAAOCAQEAZ8WP
Th+RS/FAC5ms5Ed/TdrwN3JVzZsUwDlVm2L7oohHh4y49dVSsznFOxCzn9IhYepS
ZVIL5LiHYYXnFSoM/e4hVn1QD59Hws4IL/UlHMNg8wLb/GnwjRrPa5dXrEADj/Pr
nJMzYcCPkQVdaQQLuLVvLTe9U6skVsLjKyu9y7CC+C2mQ4c0G5H8SLh19nZFFBmT
djWL1Qdxyn2VFf406u7GheJo+hRg+4IL643eRCNH6AK5YHtgVnceoMTJVKT650mH
iOCHCmgsUpypdi1++BYc4k7xnxP5BGdrVf8/uGiYtk5N9MaRyjd+tU1d6EYLHeaN
C+eX1d5j/cM+i2qj4w==
-----END CERTIFICATE-----
17 changes: 17 additions & 0 deletions tests/tls-csr.pem
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
-----BEGIN CERTIFICATE REQUEST-----
MIICnjCCAYYCAQAwWTELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUx
ITAfBgNVBAoMGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDESMBAGA1UEAwwJbG9j
YWxob3N0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAoHoQOgTFSpQh
fkA2IDZVE1LpDmi2J5wemDtov/R+RcpSb+Kqa8t2JvoCWsEYOjQYc18qslq1IVMO
1ppWHpGDChYXFluaXjo10x/M3LuHYTZgS3K4c7tum6H68oLveMr1n16y0aSDbFiu
C5sZxqJkY7koX3swasHqZ/fEzbXhIkNT7TOe8ftdu3CSXwOQ6N/taa5aikEoJ6iP
/HUIVREcXWuvZ89o6HTWqdEMJlAOl4q/jUrQQVtO57vIq2Njnj/LStjWt2s0D8NT
YyEc3HL8KO8762SWIz2CJ4PhLonrSUgNKunlRbqyE8tdfYIYALV8plM01Y5WBaL+
l9lVdNpMJQIDAQABoAAwDQYJKoZIhvcNAQELBQADggEBACjz0ki1Nm7wf9VrZopz
JxLv0ZCvcdXUWLMUqd4MKcDO2y0EoGfMeG9LJyvoB5Ptyi3gMLHgHZcBMwF0oeu6
zs9lBVOXFVtVq+qw7iBj4/RQCBdr4757Po2iiinDXqHHkqskuHhyY4uHfajSyy7G
zdFCdsxy1yI8Om6qMarkXt31LwqF8XTGaFJna4x00Xg3tRNlDBCWbYQ9nuafEz4w
OdHFnud7OU13BnV2PNHWJfmY/smZ6mum28suxYlXUZx+fuSUklRqMFD8hbp5fuWO
2XEPAorbTL3xobYxF6et9UhcIUgJqNlIZNIxlY68t/KjpDmCRYJuuK72NFWLIItg
7Og=
-----END CERTIFICATE REQUEST-----
28 changes: 28 additions & 0 deletions tests/tls-key.pem
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
-----BEGIN PRIVATE KEY-----
MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCgehA6BMVKlCF+
QDYgNlUTUukOaLYnnB6YO2i/9H5FylJv4qpry3Ym+gJawRg6NBhzXyqyWrUhUw7W
mlYekYMKFhcWW5peOjXTH8zcu4dhNmBLcrhzu26bofrygu94yvWfXrLRpINsWK4L
mxnGomRjuShfezBqwepn98TNteEiQ1PtM57x+127cJJfA5Do3+1prlqKQSgnqI/8
dQhVERxda69nz2jodNap0QwmUA6Xir+NStBBW07nu8irY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N2qR1c72wKgfwPI/ZqBC6+Q38eMjQZ6oG
YHZlm+05uav8F7xsb9pKltRSUsdThDh5S4o+FHsCgYBX6fv/GvvDDYkYtDKEcj4O
AA3bTzOX5SvfN0Wi438zI8c8R6GajimLVmJciHAlFGsCXQjUH799wo08qdSIR00m
uZhX/sevoOw8c8HQVKHzdtjxjKCfwwmxi0Wd+JtXRve5XXoni51jqNconhMBjKWz
4sCtAFYiGENU+vEgo+ON0A==
-----END PRIVATE KEY-----

0 comments on commit 316a042

Please sign in to comment.