mirror of
https://github.com/hanzozt/zt.git
synced 2026-10-30 15:04:55 +00:00
Upstream changes include: - Add get/set db version commands (#3579) - Fix link dial race condition (#3566) - Update channel version to v4.3.5 - Retire ingress-nginx in favor of Traefik (#3582) - Appease golangci-lint (#3594) - Fix flaky certchecker and link tests - Enable verbose logging for Go SDK apps - Improve router quickstart crash recovery Conflicts resolved keeping hanzozt branding while incorporating all upstream code improvements.
103 lines
2.6 KiB
Go
103 lines
2.6 KiB
Go
/*
|
|
(c) Copyright NetFoundry Inc.
|
|
|
|
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
|
|
|
|
https://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 tests
|
|
|
|
import (
|
|
"fmt"
|
|
"testing"
|
|
"time"
|
|
|
|
"github.com/hanzozt/zt/zttest/models/smoke"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestIPerf(t *testing.T) {
|
|
waitForTerminators(t, 30*time.Second,
|
|
"ert-iperf", "ert-iperf-unencrypted",
|
|
"zt-tunnel-iperf", "zt-tunnel-iperf-unencrypted")
|
|
|
|
t.Run("iperf-tests", func(t *testing.T) {
|
|
t.Run("ert-hosted", func(t *testing.T) {
|
|
t.Parallel()
|
|
|
|
for _, clientType := range []string{"ert" /*"zet",*/, "zt-tunnel"} {
|
|
for _, encrypted := range []bool{true, false} {
|
|
for _, reversed := range []bool{true, false} {
|
|
testIPerf(t, clientType, "ert", encrypted, reversed)
|
|
}
|
|
}
|
|
}
|
|
})
|
|
|
|
//t.Run("zet-hosted", func(t *testing.T) {
|
|
// t.Parallel()
|
|
//
|
|
// for _, clientType := range []string{"zet", "zt-tunnel", "ert"} {
|
|
// for _, encrypted := range []bool{true, false} {
|
|
// for _, reversed := range []bool{true, false} {
|
|
// testIPerf(t, clientType, "zet", encrypted, reversed)
|
|
// }
|
|
// }
|
|
// }
|
|
//})
|
|
|
|
t.Run("zt-tunnel-hosted", func(t *testing.T) {
|
|
t.Parallel()
|
|
|
|
for _, clientType := range []string{"zt-tunnel", "ert" /*, "zet"*/} {
|
|
for _, encrypted := range []bool{true, false} {
|
|
for _, reversed := range []bool{true, false} {
|
|
testIPerf(t, clientType, "zt-tunnel", encrypted, reversed)
|
|
}
|
|
}
|
|
}
|
|
})
|
|
})
|
|
}
|
|
|
|
func testIPerf(t *testing.T, hostSelector string, hostType string, encrypted bool, reversed bool) bool {
|
|
encDesk := "encrypted"
|
|
if !encrypted {
|
|
encDesk = "unencrypted"
|
|
}
|
|
|
|
direction := "->"
|
|
if reversed {
|
|
direction = "<-"
|
|
}
|
|
|
|
success := false
|
|
|
|
t.Run(fmt.Sprintf("(%s%s%s)-%v", hostSelector, direction, hostType, encDesk), func(t *testing.T) {
|
|
o, err := smoke.TestIperf(hostSelector, hostType, encrypted, reversed, run)
|
|
if hostType == "zet" && err != nil {
|
|
t.Skipf("zet hosted iperf test failed [%v]", err.Error())
|
|
return
|
|
}
|
|
|
|
if hostSelector == "zet" && err != nil {
|
|
t.Skipf("zet client iperf test failed [%v]", err.Error())
|
|
return
|
|
}
|
|
|
|
t.Log(o)
|
|
require.NoError(t, err)
|
|
success = true
|
|
})
|
|
return success
|
|
}
|