Add simple e2e verifying TimeZone support for CronJob

This commit is contained in:
Maciej Szulik 2022-07-26 13:28:25 +02:00
parent 130845c937
commit cb8eabe651
No known key found for this signature in database
GPG Key ID: F15E55D276FA84C4

View File

@ -298,6 +298,17 @@ var _ = SIGDescribe("CronJob", func() {
ensureHistoryLimits(f.ClientSet, f.Namespace.Name, cronJob)
})
ginkgo.It("should support timezone", func() {
ginkgo.By("Creating a cronjob with TimeZone")
cronJob := newTestCronJob("cronjob-with-timezone", "*/1 * * * ?", batchv1.AllowConcurrent,
failureCommand, nil, nil)
badTimeZone := "bad-time-zone"
cronJob.Spec.TimeZone = &badTimeZone
_, err := createCronJob(f.ClientSet, f.Namespace.Name, cronJob)
framework.ExpectError(err, "CronJob creation should fail with invalid time zone error")
framework.ExpectEqual(apierrors.IsInvalid(err), true, "CronJob creation should fail with invalid time zone error")
})
/*
Release: v1.21
Testname: CronJob API Operations