summaryrefslogtreecommitdiffstats
path: root/test/integration/openshift_health_checker/preflight/preflight_test.go
diff options
context:
space:
mode:
authorLuke Meyer <lmeyer@redhat.com>2017-03-30 13:08:34 -0400
committerLuke Meyer <lmeyer@redhat.com>2017-04-25 12:16:20 -0400
commit75f0c57654429d3b861d792169a9c1bdf9156bf8 (patch)
tree5d3e40be9e7f05d2855d8f7bd8bcaf21938e6bee /test/integration/openshift_health_checker/preflight/preflight_test.go
parent634a8957e1cc29374a170aaa8c2113b8fbbfe7e4 (diff)
downloadopenshift-75f0c57654429d3b861d792169a9c1bdf9156bf8.tar.gz
openshift-75f0c57654429d3b861d792169a9c1bdf9156bf8.tar.bz2
openshift-75f0c57654429d3b861d792169a9c1bdf9156bf8.tar.xz
openshift-75f0c57654429d3b861d792169a9c1bdf9156bf8.zip
preflight int tests: generalize; add tests
Make the container setup and teardown more reusable. Remove example tests. Add basic package tests.
Diffstat (limited to 'test/integration/openshift_health_checker/preflight/preflight_test.go')
-rw-r--r--test/integration/openshift_health_checker/preflight/preflight_test.go101
1 files changed, 91 insertions, 10 deletions
diff --git a/test/integration/openshift_health_checker/preflight/preflight_test.go b/test/integration/openshift_health_checker/preflight/preflight_test.go
index a1b98bf0f..05ddf139f 100644
--- a/test/integration/openshift_health_checker/preflight/preflight_test.go
+++ b/test/integration/openshift_health_checker/preflight/preflight_test.go
@@ -6,19 +6,100 @@ import (
. ".."
)
-func TestPreflightFailAll(t *testing.T) {
+func TestPackageUpdateDepMissing(t *testing.T) {
PlaybookTest{
- Path: "playbooks/preflight_fail_all.yml",
+ Path: "playbooks/package_update_dep_missing.yml",
ExitCode: 2,
Output: []string{
- "Failure summary",
- "Cannot install all of the necessary packages",
- "origin-clients",
- "origin-master",
- "origin-node",
- "origin-sdn-ovs",
- "python-httplib2",
- "failed=1",
+ "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)
}