Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SSH Plugin Smoke Tests #125

Merged
merged 27 commits into from May 13, 2019
Merged
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
File filter...
Filter file types
Jump to鈥
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

Prev

Fix tests that use createLinodeAndWait

  • Loading branch information...
patthiel committed May 8, 2019
commit be344f8cf82ce350503b98276f65b5be2b8d3017
@@ -17,39 +17,38 @@ setup() {

teardown() {
unset timestamp
run removeLinodes

if [ "$LAST_TEST" = "TRUE" ]; then
run removeLinodes
clearToken "$suiteName"
fi
}

@test "it should fail to rebuild without providing the image" {
run createLinodeAndWait
linode_id=$(linode-cli linodes list --format id --text --no-header | head -n 1)
rebuild_image=$(linode-cli images list --text --no-headers --format id | sed -n 3p)

run linode-cli linodes rebuild \
--image=$rebuild_image \
--root_pass=$random_pass \
$linode_id \
--text \
--no-headers

assert_failure
assert_output --partial "linode-cli: error: too few arguments"
assert_output --partial "Request failed: 400"
assert_output --partial "You must specify an image"
}

@test "it should fail to rebuild with an invalid image" {
run createLinodeAndWait

linode_id=$(linode-cli linodes list --format id --text --no-header | head -n 1)
rebuild_image="bad/image"

run linode-cli linodes rebuild \
--image=$rebuild_image \
--root_pass=$random_pass \
$linode_id \
--text \
--no-headers \
$linode_id
--no-headers

assert_failure
assert_output --partial "Request failed: 400"
@@ -60,8 +59,6 @@ teardown() {
LAST_TEST="TRUE"

if [ $RUN_LONG_TESTS = "TRUE" ]; then
run createLinodeAndWait

linode_id=$(linode-cli linodes list --format id --text --no-header | head -n 1)
rebuild_image=$(linode-cli images list --text --no-headers --format id | sed -n 3p)

@@ -26,7 +26,7 @@ teardown() {

@test "it should fail to resize to the same plan" {
local plan=$(linode-cli linodes types --format="id" --text --no-headers | sed -n 2p)
run createLinodeAndWait $plan
run createLinodeAndWait $test_image $plan
linode_id=$(linode-cli linodes list --format id --text --no-header | head -n 1)
linode_plan=$(linode-cli linodes view $linode_id --format="type" --text --no-headers)

@@ -46,7 +46,7 @@ teardown() {
smaller_plan=$(linode-cli linodes types --format="id" --text --no-headers | sed -n 1p)
local plan=$(linode-cli linodes types --format="id" --text --no-headers | sed -n 2p)

run createLinodeAndWait $plan
run createLinodeAndWait $test_image $plan
linode_id=$(linode-cli linodes list --format id --text --no-header | head -n 1)

run linode-cli linodes resize \
@@ -62,7 +62,7 @@ teardown() {

@test "it should fail to resize to an invalid plan" {
local plan=$(linode-cli linodes types --format="id" --text --no-headers | sed -n 2p)
run createLinodeAndWait $plan
run createLinodeAndWait $test_image $plan
linode_id=$(linode-cli linodes list --format id --text --no-header | head -n 1)
invalid_plan="g15-bad-plan"

ProTip! Use n and p to navigate between commits in a pull request.
You can鈥檛 perform that action at this time.