aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/conf/store_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'conf/store_test.go')
-rw-r--r--conf/store_test.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/conf/store_test.go b/conf/store_test.go
index fdef7ea7..3427a2b1 100644
--- a/conf/store_test.go
+++ b/conf/store_test.go
@@ -1,6 +1,6 @@
/* SPDX-License-Identifier: MIT
*
- * Copyright (C) 2019 WireGuard LLC. All Rights Reserved.
+ * Copyright (C) 2019-2022 WireGuard LLC. All Rights Reserved.
*/
package conf
@@ -17,7 +17,7 @@ func TestStorage(t *testing.T) {
return
}
- err = c.Save()
+ err = c.Save(true)
if err != nil {
t.Errorf("Unable to save config: %s", err.Error())
}
@@ -54,7 +54,11 @@ func TestStorage(t *testing.T) {
}
c.Interface.PrivateKey = *k
- err = c.Save()
+ err = c.Save(false)
+ if err == nil {
+ t.Error("Config disappeared or was unexpectedly overwritten")
+ }
+ err = c.Save(true)
if err != nil {
t.Errorf("Unable to save config a second time: %s", err.Error())
}