Filip Tehlar | 229f5fc | 2022-08-09 14:44:47 +0000 | [diff] [blame^] | 1 | package main |
| 2 | |
| 3 | import ( |
| 4 | "github.com/edwarnicke/exechelper" |
| 5 | ) |
| 6 | |
| 7 | func (s *NsSuite) TestHttpTps() { |
| 8 | t := s.T() |
| 9 | finished := make(chan error, 1) |
| 10 | server_ip := "10.0.0.2" |
| 11 | port := "8080" |
| 12 | dockerInstance := "http-tps" |
| 13 | |
| 14 | t.Log("starting vpp..") |
| 15 | |
| 16 | err := dockerRun(dockerInstance, "") |
| 17 | if err != nil { |
| 18 | t.Errorf("%v", err) |
| 19 | return |
| 20 | } |
| 21 | defer func() { exechelper.Run("docker stop " + dockerInstance) }() |
| 22 | |
| 23 | // start & configure vpp in the container |
| 24 | _, err = hstExec(dockerInstance, dockerInstance) |
| 25 | if err != nil { |
| 26 | t.Errorf("%v", err) |
| 27 | return |
| 28 | } |
| 29 | |
| 30 | go startWget(finished, server_ip, port, "client") |
| 31 | // wait for client |
| 32 | err = <-finished |
| 33 | if err != nil { |
| 34 | t.Errorf("%v", err) |
| 35 | } |
| 36 | } |