Skip to content

Commit

Permalink
Generate random passwords
Browse files Browse the repository at this point in the history
  • Loading branch information
patthiel committed Jul 24, 2018
1 parent 3188a0b commit 561ebde
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions test/common.bash
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,8 @@ removeLinodes() {
# Get an available image and set it as an env variable
if [ -z "$test_image" ]; then
export test_image=$(linode-cli images list --format id --text --no-header | head -n 1)
fi

if [ -z "$random_pass" ]; then
export random_pass=$(openssl rand -base64 32)
fi
4 changes: 2 additions & 2 deletions test/linodes/linodes.bats
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ load '../test_helper/bats-assert/load'
load '../common'

@test "it should create linodes with a label" {
run linode-cli linodes create --type g6-standard-2 --region us-east --image $test_image --label cli-1 --root_pass badDSFS8942 --text --delimiter "," --no-headers
run linode-cli linodes create --type g6-standard-2 --region us-east --image $test_image --label cli-1 --root_pass $random_pass --text --delimiter "," --no-headers
assert_output --regexp ".*,cli-1,us-east,g6-standard-2,$test_image,.*"
}

Expand All @@ -16,7 +16,7 @@ load '../common'
}

@test "it should create a linode with the minimum required props" {
run linode-cli linodes create --type g6-standard-2 --region us-east --root_pass badDSFS8942
run linode-cli linodes create --type g6-standard-2 --region us-east --root_pass $random_pass
[ "$status" -eq 0 ]
}

Expand Down

0 comments on commit 561ebde

Please sign in to comment.