Repository navigation
simtest: Don't depend on the environment variables of the caller - #464
Merged
Merged
Conversation
In test mode, the commands ignore the environment unless option --getenv is used. The tests that use --getenv set only some of the variables that sar and sadf read, and inisar (test 00750) always reads the environment. So these tests fail when one of the other variables is set in the environment of the user who runs do_test: - S_COLORS=always: 00192 and 00750. - S_TIME_FORMAT=ISO: 00192, 00555 and 00750. - S_REPEAT_HEADER=2: 00180, 00184, 00188, 00190, 00191, 00193 and 00194. Set these variables to an empty value in these tests, as tests 00180 and 00190 already do for S_COLORS and S_TIME_FORMAT. In these tests, an empty value gives the same output as an unset variable. Update tests/TLIST accordingly.
sa2 doesn't initialize YESTERDAY, REPORTS and LONG_NAME, and the sysconfig files used by the tests don't set them. So sa2 takes them from the caller's environment, and these values make tests 00220 and 00225 fail: - YESTERDAY=no: 00220 and 00225. - REPORTS=false: 00220 and 00225. - LONG_NAME=y: 00220. Set YESTERDAY and REPORTS to an empty value in both tests, and LONG_NAME in test 00220. Test 00225 runs with -D in SADC_OPTIONS, so sa2 sets LONG_NAME to y there anyway. Update tests/TLIST accordingly.
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.
Some simulation tests fail when sysstat variables are set in the caller's environment. For example, with
S_TIME_FORMAT=ISOexported, test 00192 fails on the date in the header:The tests that use
--getenvonly set some of the variablessarandsadfread, so the rest come from the caller.inisar(test 00750) always reads the environment, andsa2(tests 00220 and 00225) doesn't initializeYESTERDAY,REPORTSorLONG_NAME.I've set the missing variables to an empty value in those tests, like 00180 and 00190 already do for
S_COLORSandS_TIME_FORMAT.tests/TLISTis updated to match, and the commit messages list which variable breaks which test.The 00407 failure in CI is #465, not this change.