From b51d1e8cf850b469d709c8ef2d95e502cf3a12fb Mon Sep 17 00:00:00 2001 From: Ying Li Date: Mon, 25 Jan 2016 12:13:02 -0800 Subject: [PATCH] Root is always on disk unless restored from backup. (In which case if Yubikey is available, it will only be on the Yubikey and not on disk.) Signed-off-by: Ying Li --- cmd/notary/integration_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cmd/notary/integration_test.go b/cmd/notary/integration_test.go index b25c7dc9d9..eec3b1f52c 100644 --- a/cmd/notary/integration_test.go +++ b/cmd/notary/integration_test.go @@ -743,14 +743,16 @@ func TestClientCertInteraction(t *testing.T) { _, err = runCommand(t, tempDir, "-s", server.URL, "init", "gun2") assert.NoError(t, err) certs := assertNumCerts(t, tempDir, 2) - assertNumKeys(t, tempDir, 1, 4, !rootOnHardware()) + // root is always on disk, because even if there's a yubikey a backup is created + assertNumKeys(t, tempDir, 1, 4, true) // remove certs for one gun _, err = runCommand(t, tempDir, "cert", "remove", "-g", "gun1", "-y") assert.NoError(t, err) certs = assertNumCerts(t, tempDir, 1) // assert that when we remove cert by gun, we do not remove repo signing keys - assertNumKeys(t, tempDir, 1, 4, !rootOnHardware()) + // (root is always on disk, because even if there's a yubikey a backup is created) + assertNumKeys(t, tempDir, 1, 4, true) // assert that when we remove cert by gun, we also remove TUF metadata _, err = os.Stat(filepath.Join(tempDir, "tuf", "gun1")) assert.Error(t, err)