blob: 1fd15dde2f4ed0509c56ca404eaad6724dd01460 [file] [log] [blame]
Maros Ondrejickac2f76f42023-02-27 13:22:45 +01001package main
2
3import (
4 "github.com/edwarnicke/exechelper"
5)
6
Adrian Villincee15aa2024-03-14 11:42:55 -04007func init() {
Adrian Villin05b03072024-06-03 04:58:58 -04008 registerNginxTests(MirroringTest)
Adrian Villincee15aa2024-03-14 11:42:55 -04009}
10
Adrian Villin0df582e2024-05-22 09:26:47 -040011// broken when CPUS > 1
Adrian Villincee15aa2024-03-14 11:42:55 -040012func MirroringTest(s *NginxSuite) {
Adrian Villin0df582e2024-05-22 09:26:47 -040013 s.SkipIfMultiWorker()
adrianvillin28bd8f02024-02-13 06:00:02 -050014 proxyAddress := s.getInterfaceByName(mirroringClientInterfaceName).peer.ip4AddressString()
Maros Ondrejickac2f76f42023-02-27 13:22:45 +010015
16 path := "/64B.json"
17
Florin Coras87767d82023-03-06 09:46:11 -080018 testCommand := "wrk -c 20 -t 10 -d 10 http://" + proxyAddress + ":80" + path
Maros Ondrejickac2f76f42023-02-27 13:22:45 +010019 s.log(testCommand)
20 o, _ := exechelper.Output(testCommand)
21 s.log(string(o))
22 s.assertNotEmpty(o)
23
Maros Ondrejickac2f76f42023-02-27 13:22:45 +010024 vppProxyContainer := s.getContainerByName(vppProxyContainerName)
Filip Tehlar543cd572023-06-27 10:01:37 +020025 s.assertEqual(0, vppProxyContainer.vppInstance.GetSessionStat("no lcl port"))
Maros Ondrejickac2f76f42023-02-27 13:22:45 +010026}