Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions hack/make.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,19 @@ function install_pouch ()
chmod +x /usr/local/bin/runc.amd64
mv /usr/local/bin/runc.amd64 /usr/local/bin/runc

# install crictl
echo "Install crictl. "
env|sort
go get github.com/kubernetes-incubator/cri-tools/cmd/crictl
which crictl || echo "[Warning]: crictl tool doesn't exist!"
cat >/etc/crictl.yaml <<EOF
runtime-endpoint: /var/run/pouchcri.sock
image-endpoint: /var/run/pouchcri.sock
timeout: 10
debug: true
EOF
cp $GOPATH/bin/crictl /usr/local/bin/

# copy pouch daemon and pouch cli to PATH
echo "Install pouch."
cp -f $DIR/pouch $DIR/pouchd /usr/local/bin/
Expand Down
27 changes: 27 additions & 0 deletions test/cri_runpodsandbox_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package main

import (
"github.com/alibaba/pouch/test/command"
"github.com/alibaba/pouch/test/environment"
"github.com/go-check/check"
"github.com/gotestyourself/gotestyourself/icmd"
"strings"
)

// CRIRunPodSandboxSuite is the test suite for CRI RunPodSandboxSuite interface.
type CRIRunPodSandboxSuite struct{}

func init() {
check.Suite(&CRIRunPodSandboxSuite{})
}

// SetUpTest does common setup in the beginning of each test.
func (suite *CRIRunPodSandboxSuite) SetUpTest(c *check.C) {
SkipIfFalse(c, environment.IsLinux)
}

// TestRunPodSandboxSuiteWorks tests RunPodSandboxSuite could work.
func (suite *CRIRunPodSandboxSuite) TestRunPodSandboxSuiteWorks(c *check.C) {
// TODO
command.PouchRun("cri", "info").Assert(c, icmd.Success)
}
3 changes: 3 additions & 0 deletions test/environment/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ var (

// TLSConfig is default tls config
TLSConfig = utils.TLSConfig{}

// CRIListenSocket is the default listening address of CRI
CRIListenSocket = "/var/run/pouchcri.sock"
)

// IsLinux checks if the OS of test environment is Linux.
Expand Down