Fixes 'Zone is empty' errors in PD upgrade tests; skips pd tests with inline volume in multizone clusters

This commit is contained in:
Cheng Xing
2018-03-15 15:00:13 -07:00
parent 02611149c1
commit fe76c9f779
3 changed files with 20 additions and 0 deletions

View File

@@ -348,6 +348,16 @@ func SkipUnlessMultizone(c clientset.Interface) {
}
}
func SkipIfMultizone(c clientset.Interface) {
zones, err := GetClusterZones(c)
if err != nil {
Skipf("Error listing cluster zones")
}
if zones.Len() > 1 {
Skipf("Requires more than one zone")
}
}
func SkipUnlessClusterMonitoringModeIs(supportedMonitoring ...string) {
if !ClusterMonitoringModeIs(supportedMonitoring...) {
Skipf("Only next monitoring modes are supported %v (not %s)", supportedMonitoring, TestContext.ClusterMonitoringMode)