Maros Ondrejicka | c2f76f4 | 2023-02-27 13:22:45 +0100 | [diff] [blame] | 1 | package main |
| 2 | |
| 3 | import ( |
Adrian Villin | 4677d92 | 2024-06-14 09:32:39 +0200 | [diff] [blame] | 4 | . "fd.io/hs-test/infra" |
Maros Ondrejicka | c2f76f4 | 2023-02-27 13:22:45 +0100 | [diff] [blame] | 5 | "github.com/edwarnicke/exechelper" |
| 6 | ) |
| 7 | |
Adrian Villin | cee15aa | 2024-03-14 11:42:55 -0400 | [diff] [blame] | 8 | func init() { |
Adrian Villin | 4677d92 | 2024-06-14 09:32:39 +0200 | [diff] [blame] | 9 | RegisterNginxTests(MirroringTest) |
Adrian Villin | cee15aa | 2024-03-14 11:42:55 -0400 | [diff] [blame] | 10 | } |
| 11 | |
Adrian Villin | 0df582e | 2024-05-22 09:26:47 -0400 | [diff] [blame] | 12 | // broken when CPUS > 1 |
Adrian Villin | cee15aa | 2024-03-14 11:42:55 -0400 | [diff] [blame] | 13 | func MirroringTest(s *NginxSuite) { |
Adrian Villin | 0df582e | 2024-05-22 09:26:47 -0400 | [diff] [blame] | 14 | s.SkipIfMultiWorker() |
Adrian Villin | 4677d92 | 2024-06-14 09:32:39 +0200 | [diff] [blame] | 15 | proxyAddress := s.GetInterfaceByName(MirroringClientInterfaceName).Peer.Ip4AddressString() |
Maros Ondrejicka | c2f76f4 | 2023-02-27 13:22:45 +0100 | [diff] [blame] | 16 | |
| 17 | path := "/64B.json" |
| 18 | |
Florin Coras | 87767d8 | 2023-03-06 09:46:11 -0800 | [diff] [blame] | 19 | testCommand := "wrk -c 20 -t 10 -d 10 http://" + proxyAddress + ":80" + path |
Adrian Villin | 4677d92 | 2024-06-14 09:32:39 +0200 | [diff] [blame] | 20 | s.Log(testCommand) |
Maros Ondrejicka | c2f76f4 | 2023-02-27 13:22:45 +0100 | [diff] [blame] | 21 | o, _ := exechelper.Output(testCommand) |
Adrian Villin | 4677d92 | 2024-06-14 09:32:39 +0200 | [diff] [blame] | 22 | s.Log(string(o)) |
| 23 | s.AssertNotEmpty(o) |
Maros Ondrejicka | c2f76f4 | 2023-02-27 13:22:45 +0100 | [diff] [blame] | 24 | |
Adrian Villin | 4677d92 | 2024-06-14 09:32:39 +0200 | [diff] [blame] | 25 | vppProxyContainer := s.GetContainerByName(VppProxyContainerName) |
| 26 | s.AssertEqual(0, vppProxyContainer.VppInstance.GetSessionStat("no lcl port")) |
Maros Ondrejicka | c2f76f4 | 2023-02-27 13:22:45 +0100 | [diff] [blame] | 27 | } |