Skip to content

Commit

Permalink
Creates custom files in the test directory (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
juliendufresne committed Jul 10, 2016
1 parent 4c52bd8 commit c6b6350
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
3 changes: 1 addition & 2 deletions src/_report.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ save_report() {
cat "${REPORT_CURRENT_FILE}" >> "${report_file}"
fi

rm "${REPORT_CURRENT_FILE}"
REPORT_CURRENT_FILE=
}

Expand All @@ -76,7 +75,7 @@ start_new_report() {
distribution="$distribution ($codename)"
fi

REPORT_CURRENT_FILE=$(mktemp)
REPORT_CURRENT_FILE=$(readlink -m "report_line.md")

report_display_column "| Distribution |" "$distribution" >> "${REPORT_CURRENT_FILE}"
report_display_column "| last check date |" "$(date +"%F %T")" >> "${REPORT_CURRENT_FILE}"
Expand Down
10 changes: 3 additions & 7 deletions src/_run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

boot_vagrant_box() {
local is_verbose=$1
local output_file=$(mktemp)
local output_file=$(readlink -m "boot_vagrant_box__vagrant_up.out")

printf "* booting vagrant box: "
vagrant up --no-provision &>"${output_file}"
Expand Down Expand Up @@ -35,26 +35,22 @@ create_vagrantfile() {

test_clean_install() {
local is_verbose=$1
local output_file=$(mktemp)
local output_file=$(readlink -m "test_clean_install__vagrant_provision.out")

printf "* Testing clean install: "
vagrant provision &>"${output_file}"
grep -q 'unreachable=0.*failed=0' "${output_file}"
handle_result $? "${output_file}" ${is_verbose} true

rm "${output_file}"
}

test_idempotent() {
local is_verbose=$1
local output_file=$(mktemp)
local output_file=$(readlink -m "test_idempotent__vagrant_provision.out")

printf "* Idempotent test: "
vagrant provision &>"${output_file}"
grep -q 'changed=0.*unreachable=0.*failed=0' "${output_file}"
handle_result $? "${output_file}" ${is_verbose} true

rm "${output_file}"
}

run() {
Expand Down

0 comments on commit c6b6350

Please sign in to comment.