Fix conmon and runc paths for kpod tests
Tests for kpod create and run were failing because the conmon binary was being hardcoded. We added a --conmon global optioni for kpod so we could pass in the conmon path from the helpers file during tests Signed-off-by: baude <bbaude@redhat.com>
This commit is contained in:
parent
c6cc205b78
commit
b85fe5ab90
6 changed files with 11 additions and 12 deletions
|
@ -49,7 +49,7 @@ func getRuntime(c *cli.Context) (*libpod.Runtime, error) {
|
||||||
options.GraphDriverName = config.Storage
|
options.GraphDriverName = config.Storage
|
||||||
options.GraphDriverOptions = config.StorageOptions
|
options.GraphDriverOptions = config.StorageOptions
|
||||||
|
|
||||||
return libpod.NewRuntime(libpod.WithStorageConfig(options))
|
return libpod.NewRuntime(libpod.WithStorageConfig(options), libpod.WithConmonPath(config.Conmon), libpod.WithOCIRuntime(config.Runtime))
|
||||||
}
|
}
|
||||||
|
|
||||||
func shutdownStores() {
|
func shutdownStores() {
|
||||||
|
@ -82,7 +82,9 @@ func getConfig(c *cli.Context) (*libkpod.Config, error) {
|
||||||
if c.GlobalIsSet("runroot") {
|
if c.GlobalIsSet("runroot") {
|
||||||
config.RunRoot = c.GlobalString("runroot")
|
config.RunRoot = c.GlobalString("runroot")
|
||||||
}
|
}
|
||||||
|
if c.GlobalIsSet("conmon") {
|
||||||
|
config.Conmon = c.GlobalString("conmon")
|
||||||
|
}
|
||||||
if c.GlobalIsSet("storage-driver") {
|
if c.GlobalIsSet("storage-driver") {
|
||||||
config.Storage = c.GlobalString("storage-driver")
|
config.Storage = c.GlobalString("storage-driver")
|
||||||
}
|
}
|
||||||
|
|
|
@ -154,7 +154,7 @@ func createCmd(c *cli.Context) error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
defer runtime.Shutdown(false)
|
||||||
imageName, err := createImage.GetFQName()
|
imageName, err := createImage.GetFQName()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
@ -174,10 +174,6 @@ func createCmd(c *cli.Context) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := ctr.Create(); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
if c.String("cidfile") != "" {
|
if c.String("cidfile") != "" {
|
||||||
libpod.WriteFile(ctr.ID(), c.String("cidfile"))
|
libpod.WriteFile(ctr.ID(), c.String("cidfile"))
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -94,6 +94,10 @@ func main() {
|
||||||
Name: "config, c",
|
Name: "config, c",
|
||||||
Usage: "path of a config file detailing container server configuration options",
|
Usage: "path of a config file detailing container server configuration options",
|
||||||
},
|
},
|
||||||
|
cli.StringFlag{
|
||||||
|
Name: "conmon",
|
||||||
|
Usage: "path of the conmon binary",
|
||||||
|
},
|
||||||
cli.StringFlag{
|
cli.StringFlag{
|
||||||
Name: "log-level",
|
Name: "log-level",
|
||||||
Usage: "log messages above specified level: debug, info, warn, error (default), fatal or panic",
|
Usage: "log messages above specified level: debug, info, warn, error (default), fatal or panic",
|
||||||
|
|
|
@ -48,6 +48,7 @@ func runCmd(c *cli.Context) error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
defer runtime.Shutdown(false)
|
||||||
logrus.Debug("spec is ", runtimeSpec)
|
logrus.Debug("spec is ", runtimeSpec)
|
||||||
|
|
||||||
imageName, err := createImage.GetFQName()
|
imageName, err := createImage.GetFQName()
|
||||||
|
|
|
@ -99,7 +99,7 @@ CRIO_CNI_PLUGIN=${CRIO_CNI_PLUGIN:-/opt/cni/bin/}
|
||||||
POD_CIDR="10.88.0.0/16"
|
POD_CIDR="10.88.0.0/16"
|
||||||
POD_CIDR_MASK="10.88.*.*"
|
POD_CIDR_MASK="10.88.*.*"
|
||||||
|
|
||||||
KPOD_OPTIONS="--root $TESTDIR/crio $STORAGE_OPTIONS --runroot $TESTDIR/crio-run --runtime ${RUNTIME_BINARY}"
|
KPOD_OPTIONS="--root $TESTDIR/crio $STORAGE_OPTIONS --runroot $TESTDIR/crio-run --runtime ${RUNTIME_BINARY} --conmon ${CONMON_BINARY}"
|
||||||
|
|
||||||
cp "$CONMON_BINARY" "$TESTDIR/conmon"
|
cp "$CONMON_BINARY" "$TESTDIR/conmon"
|
||||||
|
|
||||||
|
|
|
@ -2,10 +2,6 @@
|
||||||
|
|
||||||
load helpers
|
load helpers
|
||||||
|
|
||||||
function teardown() {
|
|
||||||
cleanup_test
|
|
||||||
}
|
|
||||||
|
|
||||||
ALPINE="docker.io/library/alpine:latest"
|
ALPINE="docker.io/library/alpine:latest"
|
||||||
|
|
||||||
@test "run a container based on local image" {
|
@test "run a container based on local image" {
|
||||||
|
|
Loading…
Reference in a new issue