Maros Ondrejicka | c2f76f4 | 2023-02-27 13:22:45 +0100 | [diff] [blame] | 1 | package main |
| 2 | |
| 3 | import ( |
| 4 | "github.com/edwarnicke/exechelper" |
| 5 | ) |
| 6 | |
Adrian Villin | cee15aa | 2024-03-14 11:42:55 -0400 | [diff] [blame] | 7 | func init() { |
Adrian Villin | 05b0307 | 2024-06-03 04:58:58 -0400 | [diff] [blame] | 8 | registerNginxTests(MirroringTest) |
Adrian Villin | cee15aa | 2024-03-14 11:42:55 -0400 | [diff] [blame] | 9 | } |
| 10 | |
Adrian Villin | 0df582e | 2024-05-22 09:26:47 -0400 | [diff] [blame] | 11 | // broken when CPUS > 1 |
Adrian Villin | cee15aa | 2024-03-14 11:42:55 -0400 | [diff] [blame] | 12 | func MirroringTest(s *NginxSuite) { |
Adrian Villin | 0df582e | 2024-05-22 09:26:47 -0400 | [diff] [blame] | 13 | s.SkipIfMultiWorker() |
adrianvillin | 28bd8f0 | 2024-02-13 06:00:02 -0500 | [diff] [blame] | 14 | proxyAddress := s.getInterfaceByName(mirroringClientInterfaceName).peer.ip4AddressString() |
Maros Ondrejicka | c2f76f4 | 2023-02-27 13:22:45 +0100 | [diff] [blame] | 15 | |
| 16 | path := "/64B.json" |
| 17 | |
Florin Coras | 87767d8 | 2023-03-06 09:46:11 -0800 | [diff] [blame] | 18 | testCommand := "wrk -c 20 -t 10 -d 10 http://" + proxyAddress + ":80" + path |
Maros Ondrejicka | c2f76f4 | 2023-02-27 13:22:45 +0100 | [diff] [blame] | 19 | s.log(testCommand) |
| 20 | o, _ := exechelper.Output(testCommand) |
| 21 | s.log(string(o)) |
| 22 | s.assertNotEmpty(o) |
| 23 | |
Maros Ondrejicka | c2f76f4 | 2023-02-27 13:22:45 +0100 | [diff] [blame] | 24 | vppProxyContainer := s.getContainerByName(vppProxyContainerName) |
Filip Tehlar | 543cd57 | 2023-06-27 10:01:37 +0200 | [diff] [blame] | 25 | s.assertEqual(0, vppProxyContainer.vppInstance.GetSessionStat("no lcl port")) |
Maros Ondrejicka | c2f76f4 | 2023-02-27 13:22:45 +0100 | [diff] [blame] | 26 | } |