summaryrefslogtreecommitdiff
path: root/cmd/podman/common_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/podman/common_test.go')
-rw-r--r--cmd/podman/common_test.go41
1 files changed, 41 insertions, 0 deletions
diff --git a/cmd/podman/common_test.go b/cmd/podman/common_test.go
new file mode 100644
index 000000000..042568d7e
--- /dev/null
+++ b/cmd/podman/common_test.go
@@ -0,0 +1,41 @@
+package main
+
+import (
+ "os/user"
+ "testing"
+
+ "flag"
+
+ "github.com/urfave/cli"
+)
+
+func TestGetStore(t *testing.T) {
+ t.Skip("FIX THIS!")
+
+ //cmd/podman/common_test.go:27: cannot use c (type *cli.Context) as type *libkpod.Config in argument to getStore
+
+ // Make sure the tests are running as root
+ skipTestIfNotRoot(t)
+
+ set := flag.NewFlagSet("test", 0)
+ globalSet := flag.NewFlagSet("test", 0)
+ globalSet.String("root", "", "path to the root directory in which data, including images, is stored")
+ globalCtx := cli.NewContext(nil, globalSet, nil)
+ command := cli.Command{Name: "imagesCommand"}
+ c := cli.NewContext(nil, set, globalCtx)
+ c.Command = command
+
+ //_, err := getStore(c)
+ //if err != nil {
+ //t.Error(err)
+ //}
+}
+
+func skipTestIfNotRoot(t *testing.T) {
+ u, err := user.Current()
+ if err != nil {
+ t.Skip("Could not determine user. Running without root may cause tests to fail")
+ } else if u.Uid != "0" {
+ t.Skip("tests will fail unless run as root")
+ }
+}