Skip to content

Commit

Permalink
use latest image name in upgrade test
Browse files Browse the repository at this point in the history
  • Loading branch information
huikang committed Apr 29, 2023
1 parent 81e3c44 commit 3390837
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ type BuiltCluster struct {
// It returns objects of the accepting cluster, dialing cluster, staticServerSvc, and staticClientSvcSidecar
func BasicPeeringTwoClustersSetup(
t *testing.T,
consulImage string,
consulVersion string,
peeringThroughMeshgateway bool,
) (*BuiltCluster, *BuiltCluster) {
Expand All @@ -52,6 +53,7 @@ func BasicPeeringTwoClustersSetup(
NumClients: 1,
BuildOpts: &libcluster.BuildOptions{
Datacenter: "dc1",
ConsulImageName: consulImage,
ConsulVersion: consulVersion,
InjectAutoEncryption: true,
},
Expand All @@ -63,6 +65,7 @@ func BasicPeeringTwoClustersSetup(
NumClients: 1,
BuildOpts: &libcluster.BuildOptions{
Datacenter: "dc2",
ConsulImageName: consulImage,
ConsulVersion: consulVersion,
InjectAutoEncryption: true,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ import (
func TestPeering_RotateServerAndCAThenFail_(t *testing.T) {
t.Parallel()

accepting, dialing := libtopology.BasicPeeringTwoClustersSetup(t, utils.TargetVersion, false)
accepting, dialing := libtopology.BasicPeeringTwoClustersSetup(t, utils.GetTargetImageName(), utils.TargetVersion, false)
var (
acceptingCluster = accepting.Cluster
dialingCluster = dialing.Cluster
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ func TestACL_NodeToken(t *testing.T) {
NumClients: 1,
BuildOpts: &libcluster.BuildOptions{
Datacenter: "dc1",
ConsulImageName: utils.GetLatestImageName(),
ConsulVersion: utils.LatestVersion,
InjectAutoEncryption: false,
ACLEnabled: true,
Expand Down
6 changes: 3 additions & 3 deletions test/integration/consul-container/test/upgrade/basic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ func TestBasic(t *testing.T) {
t.Parallel()

configCtx := libcluster.NewBuildContext(t, libcluster.BuildOptions{
ConsulImageName: utils.GetTargetImageName(),
ConsulVersion: utils.TargetVersion,
ConsulImageName: utils.GetLatestImageName(),
ConsulVersion: utils.LatestVersion,
})

const numServers = 1
Expand All @@ -32,7 +32,7 @@ func TestBasic(t *testing.T) {
Bootstrap(numServers).
ToAgentConfig(t)
t.Logf("Cluster config:\n%s", serverConf.JSON)
require.Equal(t, utils.TargetVersion, serverConf.Version) // TODO: remove
require.Equal(t, utils.LatestVersion, serverConf.Version) // TODO: remove

cluster, err := libcluster.NewN(t, *serverConf, numServers)
require.NoError(t, err)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ func TestIngressGateway_GRPC_UpgradeToTarget_fromLatest(t *testing.T) {
NumServers: 1,
NumClients: 1,
BuildOpts: &libcluster.BuildOptions{
Datacenter: "dc1",
ConsulVersion: utils.LatestVersion,
Datacenter: "dc1",
ConsulImageName: utils.GetLatestImageName(),
ConsulVersion: utils.LatestVersion,
},
ApplyDefaultProxySettings: true,
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,9 @@ func TestIngressGateway_SDS_UpgradeToTarget_fromLatest(t *testing.T) {
NumServers: 1,
NumClients: 2,
BuildOpts: &libcluster.BuildOptions{
Datacenter: "dc1",
ConsulVersion: utils.LatestVersion,
Datacenter: "dc1",
ConsulImageName: utils.GetLatestImageName(),
ConsulVersion: utils.LatestVersion,
},
ApplyDefaultProxySettings: true,
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@ func TestIngressGateway_UpgradeToTarget_fromLatest(t *testing.T) {
NumServers: 1,
NumClients: 2,
BuildOpts: &libcluster.BuildOptions{
Datacenter: "dc1",
ConsulVersion: utils.LatestVersion,
Datacenter: "dc1",
ConsulImageName: utils.GetLatestImageName(),
ConsulVersion: utils.LatestVersion,
},
ApplyDefaultProxySettings: true,
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@ func TestTrafficManagement_ResolverSubsetRedirect(t *testing.T) {

func setup(t *testing.T) (*libcluster.Cluster, libservice.Service, libservice.Service) {
buildOpts := &libcluster.BuildOptions{
ConsulImageName: utils.GetLatestImageName(),
ConsulVersion: utils.LatestVersion,
Datacenter: "dc1",
InjectAutoEncryption: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
func TestPeering_ControlPlaneMGW(t *testing.T) {
t.Parallel()

accepting, dialing := libtopology.BasicPeeringTwoClustersSetup(t, utils.LatestVersion, true)
accepting, dialing := libtopology.BasicPeeringTwoClustersSetup(t, utils.GetLatestImageName(), utils.LatestVersion, true)
var (
acceptingCluster = accepting.Cluster
dialingCluster = dialing.Cluster
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ import (

func TestPeering_Basic(t *testing.T) {
t.Parallel()
accepting, dialing := libtopology.BasicPeeringTwoClustersSetup(t, utils.LatestVersion, false)
accepting, dialing := libtopology.BasicPeeringTwoClustersSetup(t, utils.GetLatestImageName(), utils.LatestVersion, false)
peeringUpgrade(t, accepting, dialing, utils.TargetVersion)
peeringPostUpgradeValidation(t, dialing)
}

func TestPeering_HTTPRouter(t *testing.T) {
t.Parallel()
accepting, dialing := libtopology.BasicPeeringTwoClustersSetup(t, utils.LatestVersion, false)
accepting, dialing := libtopology.BasicPeeringTwoClustersSetup(t, utils.GetLatestImageName(), utils.LatestVersion, false)
acceptingCluster := accepting.Cluster

// Create a second static-server at the client agent of accepting cluster and
Expand Down Expand Up @@ -90,7 +90,7 @@ func TestPeering_HTTPRouter(t *testing.T) {
func TestPeering_HTTPResolverAndFailover(t *testing.T) {
t.Parallel()

accepting, dialing := libtopology.BasicPeeringTwoClustersSetup(t, utils.LatestVersion, false)
accepting, dialing := libtopology.BasicPeeringTwoClustersSetup(t, utils.GetLatestImageName(), utils.LatestVersion, false)
dialingCluster := dialing.Cluster

require.NoError(t, dialingCluster.ConfigEntryWrite(&api.ProxyConfigEntry{
Expand Down Expand Up @@ -183,7 +183,7 @@ func TestPeering_HTTPResolverAndFailover(t *testing.T) {
func TestPeering_HTTPResolverAndSplitter(t *testing.T) {
t.Parallel()

accepting, dialing := libtopology.BasicPeeringTwoClustersSetup(t, utils.LatestVersion, false)
accepting, dialing := libtopology.BasicPeeringTwoClustersSetup(t, utils.GetLatestImageName(), utils.LatestVersion, false)
dialingCluster := dialing.Cluster

require.NoError(t, dialingCluster.ConfigEntryWrite(&api.ProxyConfigEntry{
Expand Down

0 comments on commit 3390837

Please sign in to comment.