blob: 57099b73d98a5a4c5fb1c8c55049d7e928788fa1 [file] [log] [blame]
Maros Ondrejickac2f76f42023-02-27 13:22:45 +01001package main
2
3import (
Adrian Villin4677d922024-06-14 09:32:39 +02004 . "fd.io/hs-test/infra"
Maros Ondrejickac2f76f42023-02-27 13:22:45 +01005 "github.com/edwarnicke/exechelper"
6)
7
Adrian Villincee15aa2024-03-14 11:42:55 -04008func init() {
Adrian Villin4677d922024-06-14 09:32:39 +02009 RegisterNginxTests(MirroringTest)
Adrian Villincee15aa2024-03-14 11:42:55 -040010}
11
Adrian Villin0df582e2024-05-22 09:26:47 -040012// broken when CPUS > 1
Adrian Villincee15aa2024-03-14 11:42:55 -040013func MirroringTest(s *NginxSuite) {
Adrian Villin0df582e2024-05-22 09:26:47 -040014 s.SkipIfMultiWorker()
Adrian Villin4677d922024-06-14 09:32:39 +020015 proxyAddress := s.GetInterfaceByName(MirroringClientInterfaceName).Peer.Ip4AddressString()
Maros Ondrejickac2f76f42023-02-27 13:22:45 +010016
17 path := "/64B.json"
18
Florin Coras87767d82023-03-06 09:46:11 -080019 testCommand := "wrk -c 20 -t 10 -d 10 http://" + proxyAddress + ":80" + path
Adrian Villin4677d922024-06-14 09:32:39 +020020 s.Log(testCommand)
Maros Ondrejickac2f76f42023-02-27 13:22:45 +010021 o, _ := exechelper.Output(testCommand)
Adrian Villin4677d922024-06-14 09:32:39 +020022 s.Log(string(o))
23 s.AssertNotEmpty(o)
Maros Ondrejickac2f76f42023-02-27 13:22:45 +010024
Adrian Villin4677d922024-06-14 09:32:39 +020025 vppProxyContainer := s.GetContainerByName(VppProxyContainerName)
26 s.AssertEqual(0, vppProxyContainer.VppInstance.GetSessionStat("no lcl port"))
Maros Ondrejickac2f76f42023-02-27 13:22:45 +010027}