There are many repeated calls to the same function with the same input in each of the Lustre test suites. One example of this is the call to
“$(lustre_version_code $SINGLEMDS)”. All test suites combined call “$(lustre_version_code $SINGLEMDS)” 269 times; sanity.sh 135 times, conf-sanity 27 times, sanityn 16 times, etc. There are 44 calls to “$(lustre_version_code ost1)” and 28 calls to “$(lustre_version_code mgs)”. There are 113 calls to "facet_fstype $SINGLEMDS" with 34 in conf-sanity alone.
Let's get the environment variables that are stable during each test suite in a routine, call it at the beginning of each test suite and export it for the test suites to use. The routine must be called after we source the configuration file
since SINGLEMDS and other variables are defined in the configuration file.
Please list any other test suite routine calls that can be reduced in this way.