Repository navigation
[TASK] Test SERVICE_CRON_OPTS with log lines that the default level does not write - #630
Merged
Merged
Conversation
…oes not write
BusyBox crond logs "USER root pid ... cmd" at its default level 8 too, so
the check of the cron log on Alpine passed without SERVICE_CRON_OPTS. It
now looks for the steps of the job (" job: 0 echo ran"), which only a lower
level logs; on Debian, the end of the job with its process id comes only
from -L 15 already. The check is a test of its own, so that a failure
names the variable and not TZ.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
testCronRunsJobsInTheTimeZoneFromTheEnvironmentalso checkedSERVICE_CRON_OPTSby looking for a cron log line in the file ofLOG_STDOUT(#623). On Alpine, that check passed without the variable: BusyBox crond logsUSER root pid … cmd echo ranat its default level 8 too. Since #623 removed the check of the command line of cron, nothing testsSERVICE_CRON_OPTSon Alpine.The check is now a test of its own,
testCronLogsAtTheLevelFromTheEnvironment, and looks for lines that the default level does not write:-L 15): the end of the job with its process id,CRON[…]: (root) END ([…] echo ran. The default writes only(root) CMD (echo ran …). This part is unchanged.-l 0): a step of the job,crond[…]: job: 0 echo ran. The default writes onlyUSER root pid … cmd echo ran ….A failure now names the variable and not
TZ.Related issues: none found.
Changes
ci/image-tests/Checks/ContainerEnvironmentChecks.php:testCronRunsJobsInTheTimeZoneFromTheEnvironmentchecks onlyTZagain; newtestCronLogsAtTheLevelFromTheEnvironment.ImageTestCase::cronOptions()andServiceChecks::testServiceOptionsFromTheEnvironment().No image changes; only the image tests.
How it was verified
Containers with a cron job, with and without
SERVICE_CRON_OPTS, read through syslog-ng from the file ofLOG_STDOUT:php-nginx:8.5-alpineUSER root pid 102 cmd echo ranonlyuser:root entry:,file root:,job: 0 echo ran, …php:8.5(Debian)(root) CMD (echo ran …)only(root) CMD ([92] echo ran …)and(root) END ([92] echo ran …)Image tests, against the published images, and against the same images where
cron.shno longer passesSERVICE_CRON_OPTSto cron:cron.shpasses the variablecron.shignores itphp-nginx:8.5-alpinetestCronLogsAtTheLevelFromTheEnvironmentphp:8.5(Debian)testCronLogsAtTheLevelFromTheEnvironmentThe old check would have passed on the Alpine image that ignores the variable: its log has
crond[107]: USER root pid 301 cmd echo ran.Rebased on master with #629;
ci/console generatechanges nothing. The CI run of this pull request runs the new test in the images that start cron, Debian and Alpine, amd64 and arm64.