From 0afeb527ff87820f0415c6173ce74803862d93ac Mon Sep 17 00:00:00 2001 From: Jose Carlos Venegas Munoz Date: Thu, 5 Dec 2019 21:48:57 +0000 Subject: [PATCH] clh: clh http unit test Add initial unit test around http client Signed-off-by: Jose Carlos Venegas Munoz --- virtcontainers/clh_test.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/virtcontainers/clh_test.go b/virtcontainers/clh_test.go index d59a18e8c..edf6c5a2f 100644 --- a/virtcontainers/clh_test.go +++ b/virtcontainers/clh_test.go @@ -4,3 +4,21 @@ // package virtcontainers + +import ( + "github.com/stretchr/testify/assert" + "testing" +) + +func TestCloudHypervisorAddVSock(t *testing.T) { + assert := assert.New(t) + clh := cloudHypervisor{} + + clh.addVSock(1, "path") + assert.Equal(clh.vmconfig.Vsock[0].Cid, int64(1)) + assert.Equal(clh.vmconfig.Vsock[0].Sock, "path") + + clh.addVSock(2, "path2") + assert.Equal(clh.vmconfig.Vsock[1].Cid, int64(2)) + assert.Equal(clh.vmconfig.Vsock[1].Sock, "path2") +}