blob: 6aab0e83de90a8808c1433e7b1b5386973cc4dad [file] [log] [blame]
//go:build integ
// +build integ
// Copyright Istio Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package sdsingressk8sca
import (
"testing"
)
import (
"github.com/apache/dubbo-go-pixiu/pkg/test/framework"
"github.com/apache/dubbo-go-pixiu/pkg/test/framework/components/echo"
"github.com/apache/dubbo-go-pixiu/pkg/test/framework/components/istio"
"github.com/apache/dubbo-go-pixiu/pkg/test/framework/resource"
"github.com/apache/dubbo-go-pixiu/tests/integration/security/sds_ingress/util"
)
var (
inst istio.Instance
apps = &util.EchoDeployments{}
)
func TestMain(m *testing.M) {
// Integration test for the ingress SDS multiple Gateway flow when
// the control plane certificate provider is k8s CA.
// nolint: staticcheck
framework.
NewSuite(m).
RequireSingleCluster().
RequireMultiPrimary().
// https://github.com/istio/istio/issues/22161. 1.22 drops support for legacy-unknown signer
RequireMaxVersion(21).
Setup(istio.Setup(&inst, setupConfig)).
Setup(func(ctx resource.Context) (err error) {
// Skip VM as eastwest gateway is disabled.
s := ctx.Settings()
s.SkipWorkloadClasses = append(s.SkipWorkloadClasses, echo.VM)
return util.SetupTest(ctx, apps)
}).
Run()
}
func setupConfig(_ resource.Context, cfg *istio.Config) {
if cfg == nil {
return
}
cfg.ControlPlaneValues = `
values:
global:
pilotCertProvider: kubernetes
`
cfg.DeployEastWestGW = false
}
func TestMtlsGatewaysK8sca(t *testing.T) {
framework.
NewTest(t).
Features("security.ingress.mtls.gateway").
Run(func(t framework.TestContext) {
t.NewSubTest("tcp").Run(func(t framework.TestContext) {
util.RunTestMultiMtlsGateways(t, inst, apps)
})
})
}
func TestTlsGatewaysK8sca(t *testing.T) {
framework.
NewTest(t).
Features("security.ingress.tls.gateway.K8sca").
Run(func(t framework.TestContext) {
t.NewSubTest("tcp").Run(func(t framework.TestContext) {
util.RunTestMultiTLSGateways(t, inst, apps)
})
})
}