blob: 07468830ecff024a9c56cef4ee8cfd745399b853 [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 pilot
import (
"fmt"
"testing"
)
import (
kubelib "github.com/apache/dubbo-go-pixiu/pkg/kube"
"github.com/apache/dubbo-go-pixiu/pkg/test/framework"
"github.com/apache/dubbo-go-pixiu/pkg/test/framework/components/echo/common/deployment"
"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/pilot/common"
)
var (
i istio.Instance
// Below are various preconfigured echo deployments. Whenever possible, tests should utilize these
// to avoid excessive creation/tear down of deployments. In general, a test should only deploy echo if
// its doing something unique to that specific test.
apps = deployment.SingleNamespaceView{}
)
func TestMain(m *testing.M) {
// nolint: staticcheck
framework.
NewSuite(m).
RequireMultiPrimary().
RequireMinVersion(17).
Setup(istio.Setup(&i, func(t resource.Context, cfg *istio.Config) {
cfg.ControlPlaneValues = fmt.Sprintf(`
values:
pilot:
env:
PILOT_USE_ENDPOINT_SLICE: "%v"`,
// for k8s 1.21+, this suite should test disabling EndpointSlice mode
kubelib.IsLessThanVersion(t.Clusters().Kube().Default(), 21))
})).
Setup(deployment.SetupSingleNamespace(&apps)).
Run()
}
func TestTraffic(t *testing.T) {
framework.
NewTest(t).
Features("traffic.routing", "traffic.reachability", "traffic.shifting").
Run(func(t framework.TestContext) {
common.RunAllTrafficTests(t, i, &apps)
})
}