Skip to content

Commit

Permalink
Fix tmpdevid unit tests.
Browse files Browse the repository at this point in the history
Signed-off-by: Edwin Buck <[email protected]>
  • Loading branch information
edwbuck committed Aug 30, 2024
1 parent 6d1da6d commit 58cd9b2
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions pkg/server/plugin/nodeattestor/tpmdevid/devid_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,40 +88,40 @@ func TestConfigure(t *testing.T) {
}{
{
name: "Configure fails if core config is not provided",
expErr: "rpc error: code = InvalidArgument desc = core configuration is missing",
expErr: "rpc error: code = InvalidArgument desc = server core configuration is required",
},
{
name: "Configure fails if trust domain is empty",
expErr: "rpc error: code = InvalidArgument desc = trust_domain is required",
expErr: "rpc error: code = InvalidArgument desc = server core configuration must contain trust_domain",
coreConf: &configv1.CoreConfiguration{},
},
{
name: "Configure fails if HCL config cannot be decoded",
expErr: "rpc error: code = InvalidArgument desc = unable to decode configuration",
expErr: "rpc error: code = InvalidArgument desc = plugin configuration is malformed",
coreConf: &configv1.CoreConfiguration{TrustDomain: "example.org"},
hclConf: "not an HCL configuration",
},
{
name: "Configure fails if devid_ca_path is not provided",
expErr: "rpc error: code = InvalidArgument desc = invalid configuration: devid_ca_path is required",
expErr: "rpc error: code = InvalidArgument desc = devid_ca_path is required",
coreConf: &configv1.CoreConfiguration{TrustDomain: "example.org"},
},
{
name: "Configure fails if endorsement_ca_path is not provided",
expErr: "rpc error: code = InvalidArgument desc = invalid configuration: endorsement_ca_path is required",
expErr: "rpc error: code = InvalidArgument desc = endorsement_ca_path is required",
coreConf: &configv1.CoreConfiguration{TrustDomain: "example.org"},
hclConf: `devid_ca_path = "non-existent/devid/bundle/path"`,
},
{
name: "Configure fails if DevID trust bundle cannot be loaded",
expErr: "rpc error: code = Internal desc = unable to load DevID trust bundle: open non-existent/devid/bundle/path:",
expErr: "rpc error: code = InvalidArgument desc = unable to load DevID trust bundle: open non-existent/devid/bundle/path:",
coreConf: &configv1.CoreConfiguration{TrustDomain: "example.org"},
hclConf: `devid_ca_path = "non-existent/devid/bundle/path"
endorsement_ca_path = "non-existent/endorsement/bundle/path"`,
},
{
name: "Configure fails if endorsement trust bundle cannot be opened",
expErr: "rpc error: code = Internal desc = unable to load endorsement trust bundle: open non-existent/endorsement/bundle/path:",
expErr: "rpc error: code = InvalidArgument desc = unable to load endorsement trust bundle: open non-existent/endorsement/bundle/path:",
coreConf: &configv1.CoreConfiguration{TrustDomain: "example.org"},
hclConf: fmt.Sprintf(`devid_ca_path = %q
endorsement_ca_path = "non-existent/endorsement/bundle/path"`,
Expand Down

0 comments on commit 58cd9b2

Please sign in to comment.