37 lines
768 B
Bash
37 lines
768 B
Bash
#!/usr/bin/env bash
|
|
|
|
setup_file(){
|
|
load "$PWD/tests/integration/helpers/common"
|
|
_common_setup
|
|
_add_server
|
|
}
|
|
|
|
teardown_file(){
|
|
_rm_server
|
|
}
|
|
|
|
setup(){
|
|
load "$PWD/tests/integration/helpers/common"
|
|
_common_setup
|
|
}
|
|
|
|
@test "validate server" {
|
|
run $ABRA server remove --no-input
|
|
assert_failure
|
|
assert_output --partial 'no server provided'
|
|
|
|
run $ABRA server remove foo
|
|
assert_failure
|
|
assert_output --partial "server doesn't exist"
|
|
}
|
|
|
|
@test "remove server" {
|
|
assert_exists "$ABRA_DIR/servers/$TEST_SERVER"
|
|
assert bash -c "docker context ls | grep -q $TEST_SERVER"
|
|
|
|
run $ABRA server remove --no-input "$TEST_SERVER"
|
|
assert_success
|
|
assert_not_exists "$ABRA_DIR/servers/$TEST_SERVER"
|
|
refute bash -c "docker context ls | grep -q $TEST_SERVER"
|
|
}
|