home: add tests

This commit is contained in:
Stanislav Chzhen
2025-05-13 22:23:41 +03:00
parent 88706e9cf2
commit 6109e3575f
2 changed files with 237 additions and 1 deletions

View File

@@ -114,6 +114,7 @@ func TestValidateCertificates(t *testing.T) {
//
// The global variables are:
// - [configuration]
// - [homeContext.auth]
// - [homeContext.clients.storage]
// - [homeContext.dnsServer]
// - [homeContext.firstRun]
@@ -126,6 +127,7 @@ func storeGlobals(tb testing.TB) {
tb.Helper()
prevConfig := config
auth := globalContext.auth
storage := globalContext.clients.storage
dnsServer := globalContext.dnsServer
firstRun := globalContext.firstRun
@@ -134,6 +136,7 @@ func storeGlobals(tb testing.TB) {
tb.Cleanup(func() {
config = prevConfig
globalContext.auth = auth
globalContext.clients.storage = storage
globalContext.dnsServer = dnsServer
globalContext.firstRun = firstRun