diff options
author | OpenShift Bot <eparis+openshiftbot@redhat.com> | 2017-04-26 01:23:28 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-26 01:23:28 -0500 |
commit | c12b00944940cd7f425323e1598a4b7683ddaf75 (patch) | |
tree | d1cb21b763579a5c5a2fa5dd0c30078b7383bbe7 /test/integration/openshift_health_checker/preflight/preflight_test.go | |
parent | 760bdbc78081d9780d2618c422f31913dd9d38c7 (diff) | |
parent | e5f14b515b07bcfa2079c3e68c35fee3e97970c7 (diff) | |
download | openshift-c12b00944940cd7f425323e1598a4b7683ddaf75.tar.gz openshift-c12b00944940cd7f425323e1598a4b7683ddaf75.tar.bz2 openshift-c12b00944940cd7f425323e1598a4b7683ddaf75.tar.xz openshift-c12b00944940cd7f425323e1598a4b7683ddaf75.zip |
Merge pull request #3816 from sosiouxme/20170328-integration-tests
Merged by openshift-bot
Diffstat (limited to 'test/integration/openshift_health_checker/preflight/preflight_test.go')
-rw-r--r-- | test/integration/openshift_health_checker/preflight/preflight_test.go | 105 |
1 files changed, 105 insertions, 0 deletions
diff --git a/test/integration/openshift_health_checker/preflight/preflight_test.go b/test/integration/openshift_health_checker/preflight/preflight_test.go new file mode 100644 index 000000000..05ddf139f --- /dev/null +++ b/test/integration/openshift_health_checker/preflight/preflight_test.go @@ -0,0 +1,105 @@ +package preflight + +import ( + "testing" + + . ".." +) + +func TestPackageUpdateDepMissing(t *testing.T) { + PlaybookTest{ + Path: "playbooks/package_update_dep_missing.yml", + ExitCode: 2, + Output: []string{ + "check \"package_update\":", + "Could not perform a yum update.", + "break-yum-update-1.0-2.noarch requires package-that-does-not-exist", + }, + }.Run(t) +} + +func TestPackageUpdateRepoBroken(t *testing.T) { + PlaybookTest{ + Path: "playbooks/package_update_repo_broken.yml", + ExitCode: 2, + Output: []string{ + "check \"package_update\":", + "Error with yum repository configuration: Cannot find a valid baseurl for repo", + }, + }.Run(t) +} + +func TestPackageUpdateRepoDisabled(t *testing.T) { + PlaybookTest{ + Path: "playbooks/package_update_repo_disabled.yml", + ExitCode: 0, + Output: []string{ + "CHECK [package_update", + }, + }.Run(t) +} + +func TestPackageUpdateRepoUnreachable(t *testing.T) { + PlaybookTest{ + Path: "playbooks/package_update_repo_unreachable.yml", + ExitCode: 2, + Output: []string{ + "check \"package_update\":", + "Error getting data from at least one yum repository", + }, + }.Run(t) +} + +func TestPackageVersionMatches(t *testing.T) { + PlaybookTest{ + Path: "playbooks/package_version_matches.yml", + ExitCode: 0, + Output: []string{ + "CHECK [package_version", + }, + }.Run(t) +} + +func TestPackageVersionMismatches(t *testing.T) { + PlaybookTest{ + Path: "playbooks/package_version_mismatches.yml", + ExitCode: 2, + Output: []string{ + "check \"package_version\":", + "Not all of the required packages are available at requested version", + }, + }.Run(t) +} + +func TestPackageVersionMultiple(t *testing.T) { + PlaybookTest{ + Path: "playbooks/package_version_multiple.yml", + ExitCode: 2, + Output: []string{ + "check \"package_version\":", + "Multiple minor versions of these packages are available", + }, + }.Run(t) +} + +func TestPackageAvailabilityMissingRequired(t *testing.T) { + PlaybookTest{ + Path: "playbooks/package_availability_missing_required.yml", + ExitCode: 2, + Output: []string{ + "check \"package_availability\":", + "Cannot install all of the necessary packages.", + "atomic-openshift", + }, + }.Run(t) +} + +func TestPackageAvailabilitySucceeds(t *testing.T) { + PlaybookTest{ + Path: "playbooks/package_availability_succeeds.yml", + ExitCode: 0, + Output: []string{ + "CHECK [package_availability", + }, + }.Run(t) +} |