diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2018-11-16 08:51:42 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-16 08:51:42 -0800 |
commit | cd5742ff47f2650e1f33dd485485cd5027500955 (patch) | |
tree | 7d24f45eb0f5287de9d059af9e9b1c214e8565a3 /test/goecho/goecho.go | |
parent | 4abf439e4bda8836cd68101d1f1cb09bc9105b17 (diff) | |
parent | c1bc0a71920fa3f8884cd5066b026570982c66e9 (diff) | |
download | podman-cd5742ff47f2650e1f33dd485485cd5027500955.tar.gz podman-cd5742ff47f2650e1f33dd485485cd5027500955.tar.bz2 podman-cd5742ff47f2650e1f33dd485485cd5027500955.zip |
Merge pull request #1385 from ypu/systemtest
Add system test with ginkgo
Diffstat (limited to 'test/goecho/goecho.go')
-rw-r--r-- | test/goecho/goecho.go | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/test/goecho/goecho.go b/test/goecho/goecho.go new file mode 100644 index 000000000..1c8d2f586 --- /dev/null +++ b/test/goecho/goecho.go @@ -0,0 +1,29 @@ +package main + +import ( + "fmt" + "os" + "strconv" + "time" +) + +func main() { + args := os.Args[1:] + exitCode := 0 + + for i := 0; i < len(args); i++ { + fmt.Fprintln(os.Stdout, args[i]) + fmt.Fprintln(os.Stderr, args[i]) + } + + if len(args) > 1 { + num, _ := strconv.Atoi(args[1]) + if args[0] == "exitcode" { + exitCode = num + } + if args[0] == "sleep" { + time.Sleep(time.Duration(num) * time.Second) + } + } + os.Exit(exitCode) +} |