Add automatic configuration reloading and

policy handling
This commit is contained in:
Travis Groth 2019-05-30 08:48:56 -04:00
parent 77f3933560
commit 8c2beac6f1
12 changed files with 287 additions and 34 deletions

View file

@ -355,3 +355,23 @@ func Test_parsePolicyFile(t *testing.T) {
})
}
}
func Test_Checksum(t *testing.T) {
o := NewOptions()
oldChecksum := o.Checksum()
o.SharedKey = "changemeplease"
newChecksum := o.Checksum()
if newChecksum == oldChecksum {
t.Errorf("Checksum() failed to update old = %s, new = %s", oldChecksum, newChecksum)
}
if newChecksum == "" || oldChecksum == "" {
t.Error("Checksum() not returning data")
}
if o.Checksum() != o.Checksum() {
t.Error("Checksum() inconsistent")
}
}