Skip to content

Commit

Permalink
Fix provisioning "no submit uri" test failure
Browse files Browse the repository at this point in the history
The error message in this case appears to have changed not to include
the DNS resolver address, resulting in the expected error failure.

To get around that and make the test more robust, check just for the "no
such host" fragment inside the error message, rather than attempting to
match the entire message.

Signed-off-by: Sergei Trofimov <[email protected]>
  • Loading branch information
setrofim committed Sep 5, 2023
1 parent f6dea78 commit f989238
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions provisioning/provisioning_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,8 @@ func TestSubmitConfig_Run_no_submit_uri(t *testing.T) {
func TestSubmitConfig_Run_fail_no_server(t *testing.T) {
tv := SubmitConfig{SubmitURI: testSubmitURI}

expectedErr := `submit request failed: Post "http://veraison.example/endorsement-provisioning/v1/submit": dial tcp: lookup veraison.example on 127.0.0.53:53: no such host`

err := tv.Run(testEndorsement, testEndorsementMediaType)
assert.EqualError(t, err, expectedErr)
assert.ErrorContains(t, err, "no such host")
}

func TestSubmitConfig_Run_fail_404_response(t *testing.T) {
Expand Down

0 comments on commit f989238

Please sign in to comment.