[Lustre-devel] Language choice for Lustre tests

Kilian Cavalotti kilian.cavalotti.work at gmail.com
Fri Oct 26 04:53:26 PDT 2012


Hi Roman,

> Few samples, which comparably hard to implement on bash than on other
> languages from my point of view (especially via evolving tes-framework.sh):

I don't really want to engage in a code battle I would definitely
loose, and I'm also not very familiar with the current test framework
inner workings, but here are a few points.

> - how could be implemented for current framework random and repeatable
> test execution?

Not sure what's required here, but how about storing the list of tests
in a Bash array, generating a list of random indexes, and using it to
loop over the test array?

> - how could be implemented observation of remote node status while
> command executed on it and killed it by timeout?

One can read a SSH output stream with the appropriate redirections and
act upon results, stdout or stderr contents, and/or return codes. The
read Bash builtin takes a timeout parameter, and "timeout" is also an
often overlooked coreutils command. :)

> - how simple add machine-readable meta information for test, e.f. tags
> and timeouts?

With an associative array, for instance:
$ declare -A TESTS
$ TESTS=( [test1]="tag1:timeout1"
        [test2]="tag2:timeout2"
        [test3]="tag3:timeout3" )
$ for test in ${!TESTS[@]}; do
        value=${TESTS[$test]}
        tag=${value%%:*}
        timeout=${value##*:}
        printf "%s is tagged with %s and has a timeout of %s.\n" $test
$tag $timeout
done
test1 is tagged with tag1 and has a timeout of timeout1.
test2 is tagged with tag2 and has a timeout of timeout2.
test3 is tagged with tag3 and has a timeout of timeout3.

Cheers,
--
Kilian



More information about the lustre-devel mailing list