summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorbaude <bbaude@redhat.com>2018-01-02 16:29:43 -0600
committerAtomic Bot <atomic-devel@projectatomic.io>2018-01-08 19:12:17 +0000
commit7b08aa78e4ede4c54fda6cd9917bb62e18d0d634 (patch)
tree1c480d9dfb8db3268dc3fdcca827792278a3ae47 /test
parent6baf6e461de6e560cc48d35239e7c392bec4481c (diff)
downloadpodman-7b08aa78e4ede4c54fda6cd9917bb62e18d0d634.tar.gz
podman-7b08aa78e4ede4c54fda6cd9917bb62e18d0d634.tar.bz2
podman-7b08aa78e4ede4c54fda6cd9917bb62e18d0d634.zip
Shortcut for most recent container
It is desirable to have a shortcut for the most recently created container. We can now use "**latest" to represent the most recent container instead of its container ID or name. For example: Signed-off-by: baude <bbaude@redhat.com> Closes: #179 Approved by: baude
Diffstat (limited to 'test')
-rw-r--r--test/podman_exec.bats7
-rw-r--r--test/podman_inspect.bats3
-rw-r--r--test/podman_kill.bats7
-rw-r--r--test/podman_logs.bats5
-rw-r--r--test/podman_stop.bats7
5 files changed, 24 insertions, 5 deletions
diff --git a/test/podman_exec.bats b/test/podman_exec.bats
index 2d6a42704..f62da59a3 100644
--- a/test/podman_exec.bats
+++ b/test/podman_exec.bats
@@ -28,3 +28,10 @@ function setup() {
echo "$output"
[ "$status" -eq 0 ]
}
+
+@test "exec simple command using latest" {
+ ${PODMAN_BINARY} ${PODMAN_OPTIONS} run -d -t ${ALPINE} sleep 60
+ run ${PODMAN_BINARY} ${PODMAN_OPTIONS} exec -l ls
+ echo "$output"
+ [ "$status" -eq 0 ]
+}
diff --git a/test/podman_inspect.bats b/test/podman_inspect.bats
index 5c353aae8..9f9336f48 100644
--- a/test/podman_inspect.bats
+++ b/test/podman_inspect.bats
@@ -45,8 +45,7 @@ function setup() {
run bash -c "${PODMAN_BINARY} ${PODMAN_OPTIONS} create ${BB} ls"
echo "$output"
[ "$status" -eq 0 ]
- ctr_id="$output"
- run bash -c "${PODMAN_BINARY} $PODMAN_OPTIONS inspect --size $ctr_id | python -m json.tool | grep SizeRootFs"
+ run bash -c "${PODMAN_BINARY} $PODMAN_OPTIONS inspect --size -l | python -m json.tool | grep SizeRootFs"
echo "$output"
[ "$status" -eq 0 ]
}
diff --git a/test/podman_kill.bats b/test/podman_kill.bats
index 1ccf373bb..bb55ed31d 100644
--- a/test/podman_kill.bats
+++ b/test/podman_kill.bats
@@ -62,3 +62,10 @@ function setup() {
run bash -c "${PODMAN_BINARY} ${PODMAN_OPTIONS} ps --no-trunc"
[ "$status" -eq 0 ]
}
+
+@test "kill the latest container run" {
+ ${PODMAN_BINARY} ${PODMAN_OPTIONS} run -d ${ALPINE} sleep 9999
+ run bash -c "${PODMAN_BINARY} ${PODMAN_OPTIONS} kill -l"
+ echo "$output"
+ [ "$status" -eq 0 ]
+}
diff --git a/test/podman_logs.bats b/test/podman_logs.bats
index 4c20654a7..342ffac5e 100644
--- a/test/podman_logs.bats
+++ b/test/podman_logs.bats
@@ -42,11 +42,10 @@ function setup() {
run bash -c "${PODMAN_BINARY} ${PODMAN_OPTIONS} run -d $BB ls"
echo "$output"
[ "$status" -eq 0 ]
- ctr_id="$output"
- run bash -c "${PODMAN_BINARY} ${PODMAN_OPTIONS} logs --since 2017-08-07T10:10:09.056611202-04:00 $ctr_id"
+ run bash -c "${PODMAN_BINARY} ${PODMAN_OPTIONS} logs --since 2017-08-07T10:10:09.056611202-04:00 -l"
echo "$output"
[ "$status" -eq 0 ]
- run bash -c "${PODMAN_BINARY} ${PODMAN_OPTIONS} rm $ctr_id"
+ run bash -c "${PODMAN_BINARY} ${PODMAN_OPTIONS} rm -l"
echo "$output"
[ "$status" -eq 0 ]
}
diff --git a/test/podman_stop.bats b/test/podman_stop.bats
index 498d71838..839301435 100644
--- a/test/podman_stop.bats
+++ b/test/podman_stop.bats
@@ -47,3 +47,10 @@ function setup() {
echo "$output"
[ "$status" -eq 0 ]
}
+
+@test "stop a container with latest" {
+ ${PODMAN_BINARY} ${PODMAN_OPTIONS} run -d ${ALPINE} sleep 9999
+ run bash -c "${PODMAN_BINARY} ${PODMAN_OPTIONS} stop -t 1 -l"
+ echo "$output"
+ [ "$status" -eq 0 ]
+}