Skip to content

Commit

Permalink
clh: clh http unit test
Browse files Browse the repository at this point in the history
Add initial unit test around http client

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
  • Loading branch information
jcvenegas committed Dec 6, 2019
1 parent 42061f6 commit 0afeb52
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions virtcontainers/clh_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}

0 comments on commit 0afeb52

Please sign in to comment.