diff --git a/.gitignore b/.gitignore index 33899cf..61dcdf4 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,9 @@ towerops-agent cover.out cover.html +# Runtime data +known_hosts.json + # Database files *.db *.db-shm diff --git a/hostkeys_test.go b/hostkeys_test.go index 7b75675..b36586c 100644 --- a/hostkeys_test.go +++ b/hostkeys_test.go @@ -76,10 +76,9 @@ func TestHostKeyStoreConcurrency(t *testing.T) { func TestGetHostKeyStoreDefault(t *testing.T) { // Reset the once for testing - origOnce := hostKeysOnce origStore := globalHostKeys defer func() { - hostKeysOnce = origOnce + hostKeysOnce = sync.Once{} globalHostKeys = origStore }() hostKeysOnce = sync.Once{} @@ -93,10 +92,9 @@ func TestGetHostKeyStoreDefault(t *testing.T) { func TestSSHHostKeyCallback(t *testing.T) { // Reset global state - origOnce := hostKeysOnce origStore := globalHostKeys defer func() { - hostKeysOnce = origOnce + hostKeysOnce = sync.Once{} globalHostKeys = origStore }() hostKeysOnce = sync.Once{} diff --git a/known_hosts.json b/known_hosts.json deleted file mode 100644 index 4982bec..0000000 --- a/known_hosts.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "127.0.0.1:34241": "7b15d4949c86819c72610bb15661751a258ba039010e1544d8a6a2291411844c", - "127.0.0.1:38017": "2aaf02f4a6e47ece1361d10df54c8af2ffd8f43f8d3ad0d3d1b8cf42107e0bea", - "127.0.0.1:42691": "fd4c0283f9848d207364b309eb894f54516e0b2d6c0935399a514a0504e31f4d", - "127.0.0.1:44377": "a0b1c55bc4c006fe871315e6a95d49afd1af3ac90e0309f1afae98acf003a5b9" -} \ No newline at end of file