-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
E2E: refactor Connect tests to use stdlib testing
Migrate our E2E tests for Connect off the old framework in preparation for writing E2E tests for transparent proxy and the updated workload identity workflow. Mark the tests that cover the legacy Consul token submitted workflow. Ref: #20175
- Loading branch information
Showing
10 changed files
with
432 additions
and
831 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// Copyright (c) HashiCorp, Inc. | ||
// SPDX-License-Identifier: BUSL-1.1 | ||
|
||
package connect | ||
|
||
import ( | ||
"testing" | ||
|
||
capi "github.com/hashicorp/consul/api" | ||
"github.com/hashicorp/nomad/e2e/e2eutil" | ||
"github.com/hashicorp/nomad/e2e/v3/jobs3" | ||
"github.com/shoenig/test" | ||
"github.com/shoenig/test/must" | ||
) | ||
|
||
func TestConnect_ClientRestart(t *testing.T) { | ||
t.Skip("skipping test that does nomad agent restart") | ||
|
||
nomadClient := e2eutil.NomadClient(t) | ||
e2eutil.WaitForLeader(t, nomadClient) | ||
e2eutil.WaitForNodesReady(t, nomadClient, 2) | ||
|
||
sub, cleanup := jobs3.Submit(t, "./input/demo.nomad") | ||
t.Cleanup(cleanup) | ||
|
||
cc := e2eutil.ConsulClient(t) | ||
|
||
ixn := &capi.Intention{ | ||
SourceName: "count-dashboard", | ||
DestinationName: "count-api", | ||
Action: "allow", | ||
} | ||
_, err := cc.Connect().IntentionUpsert(ixn, nil) | ||
must.NoError(t, err, must.Sprint("could not create intention")) | ||
|
||
t.Cleanup(func() { | ||
_, err := cc.Connect().IntentionDeleteExact("count-dashboard", "count-api", nil) | ||
test.NoError(t, err) | ||
}) | ||
|
||
assertServiceOk(t, cc, "count-api-sidecar-proxy") | ||
assertServiceOk(t, cc, "count-dashboard-sidecar-proxy") | ||
|
||
nodeID := sub.Allocs()[0].NodeID | ||
_, err = e2eutil.AgentRestart(nomadClient, nodeID) | ||
must.Error(t, err, must.Sprint("node cannot be restarted")) | ||
|
||
assertServiceOk(t, cc, "count-api-sidecar-proxy") | ||
assertServiceOk(t, cc, "count-dashboard-sidecar-proxy") | ||
} |
Oops, something went wrong.