hs-test: add vppctl wrapper script 41/38441/2
authorFilip Tehlar <ftehlar@cisco.com>
Wed, 8 Mar 2023 10:55:50 +0000 (11:55 +0100)
committerFilip Tehlar <ftehlar@cisco.com>
Wed, 8 Mar 2023 11:08:07 +0000 (12:08 +0100)
Type: test

Add a helper wrapper script for vppctl called vppcli to vpp docker image
with proper cli socket path.

Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: I1a51aa54bc91c1c812698501a56401c525d498e8

extras/hs-test/vppinstance.go

index c6771f6..89e67d0 100644 (file)
@@ -117,6 +117,12 @@ func (vpp *VppInstance) start() error {
        startupFileName := vpp.getEtcDir() + "/startup.conf"
        vpp.container.createFile(startupFileName, configContent)
 
+       // create wrapper script for vppctl with proper CLI socket path
+       cliContent := "#!/usr/bin/bash\nvppctl -s " + vpp.getRunDir() + "/cli.sock"
+       vppcliFileName := "/usr/bin/vppcli"
+       vpp.container.createFile(vppcliFileName, cliContent)
+       vpp.container.exec("chmod 0755 " + vppcliFileName)
+
        if *IsVppDebug {
                sig := make(chan os.Signal, 1)
                signal.Notify(sig, syscall.SIGINT)