[tests] Fix exit code check for systemctl

This commit is contained in:
Nik Everett 2015-09-01 15:24:04 -04:00
parent 99d2f0463e
commit 38147da43e
1 changed files with 3 additions and 3 deletions

View File

@ -93,7 +93,7 @@ setup() {
systemctl stop elasticsearch.service systemctl stop elasticsearch.service
run systemctl status elasticsearch.service run systemctl status elasticsearch.service
[ "$status" -eq 0 ] [ "$status" -eq 3 ] || "Expected exit code 3 meaning stopped"
echo "$output" | grep "Active:" | grep "inactive" echo "$output" | grep "Active:" | grep "inactive"
} }
@ -101,13 +101,13 @@ setup() {
systemctl stop elasticsearch.service systemctl stop elasticsearch.service
run systemctl status elasticsearch.service run systemctl status elasticsearch.service
[ "$status" -eq 0 ] [ "$status" -eq 3 ] || "Expected exit code 3 meaning stopped"
echo "$output" | grep "Active:" | grep "inactive" echo "$output" | grep "Active:" | grep "inactive"
} }
@test "[SYSTEMD] status (stopped)" { @test "[SYSTEMD] status (stopped)" {
run systemctl status elasticsearch.service run systemctl status elasticsearch.service
[ "$status" -eq 0 ] [ "$status" -eq 3 ] || "Expected exit code 3 meaning stopped"
echo "$output" | grep "Active:" | grep "inactive" echo "$output" | grep "Active:" | grep "inactive"
} }