ATF-devel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

config vars from shell scripts?

What's the correct way to use a config var from within a shell script test?

I tried:

$(atf_get testvar)

which I set with:

atf-run -v testvar=foo

... but I only got an empty string.  What am I doing wrong?

Also, I'm a little concerned about this comment in the implementation of atf_get:

# atf_get varname
#   Prints the value of a test case-specific variable.  Given that one
#   should not get the value of non-existent variables, it is fine to
#   always use this function as 'val=$(atf_get var)'.

"one should not get the value of non-existent variables"?

Does this mean that if I use a variable AT ALL, I have to make sure it's set in every instance? That seems... suboptimal. Perhaps I'm misunderstanding.


Home | Main Index | Thread Index | Old Index