Merge pull request #1125 from hairyhenderson/ls-filter-1076

Adding --filter flag to ls command
This commit is contained in:
Evan Hazlett
2015-05-12 08:10:58 -04:00
5 changed files with 408 additions and 6 deletions

27
test/integration/ls.bats Normal file
View File

@@ -0,0 +1,27 @@
#!/usr/bin/env bats
load helpers
teardown() {
echo "$BATS_TEST_NAME
----------
$output
----------
" >> ${BATS_LOG}
machine rm -f testmachine
}
@test "ls: filter on driver" {
run machine create -d none --url tcp://127.0.0.1:2375 testmachine
run machine ls --filter driver=none
[ "$status" -eq 0 ]
[[ ${lines[1]} =~ "testmachine" ]]
}
@test "ls: filter on swarm" {
run machine create -d none --url tcp://127.0.0.1:2375 --swarm --swarm-master --swarm-discovery token://deadbeef testmachine
run machine ls --filter swarm=testmachine
[ "$status" -eq 0 ]
[[ ${lines[1]} =~ "testmachine" ]]
}