Skip to content
This repository has been archived by the owner on Feb 24, 2020. It is now read-only.

trust: fix regression on --root #1494

Merged
merged 2 commits into from Sep 28, 2015
Merged

trust: fix regression on --root #1494

merged 2 commits into from Sep 28, 2015

Conversation

alban
Copy link
Member

@alban alban commented Sep 28, 2015

Fixes #1491

Also, add a functional test for rkt trust.

t.Fatalf("Expected but didn't find %q in %v", expected, err)
}

child.SendLine("yes")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing err =

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or put it inside the if, also, we need to print the error

t.Logf("Trust the key with the correct prefix\n")
runRktTrust(t, ctx, "coreos.com/rkt-inspect")

t.Logf("Finally, run successfull the signed image\n")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"successfully"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@alban
Copy link
Member Author

alban commented Sep 28, 2015

@iaguis : thanks for the review. Branch updated.

t.Logf("Trust the key even more\n")
runRktTrust(t, ctx, "foo.com")
runRktTrust(t, ctx, "example.com/my-app")
runRktTrust(t, ctx, "") // --root
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we also test only trusting the key with --root and make sure it works?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I added a test for --root on imageFile2.

@alban alban force-pushed the alban/trust-root branch 2 times, most recently from c44589a to 36b62d9 Compare September 28, 2015 14:17
@alban
Copy link
Member Author

alban commented Sep 28, 2015

@iaguis updated again.

func TestTrust(t *testing.T) {
imageFile := patchTestACI("rkt-inspect-trust1.aci", "--exec=/inspect --print-msg=Hello", "--name=rkt-prefix.com/my-app")
defer os.Remove(imageFile)
defer os.Remove(imageFile + ".asc")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It probably doesn't matter but the signature file is not created until you call runSignImage so this should appear after that.

@iaguis
Copy link
Member

iaguis commented Sep 28, 2015

A couple of nits but LGTM

@alban
Copy link
Member Author

alban commented Sep 28, 2015

Updated

@iaguis
Copy link
Member

iaguis commented Sep 28, 2015

Merge on green 👍

@iaguis iaguis added this to the v0.9.0 milestone Sep 28, 2015
alban added a commit that referenced this pull request Sep 28, 2015
trust: fix regression on --root
@alban alban merged commit 9a17d1a into rkt:master Sep 28, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants