2016-10-11 04:18:05 +00:00
|
|
|
import testinfra
|
|
|
|
|
|
|
|
run_local = testinfra.get_backend(
|
|
|
|
"local://"
|
|
|
|
).get_module("Command").run
|
|
|
|
|
2018-07-02 20:54:19 +00:00
|
|
|
|
2016-10-11 04:18:05 +00:00
|
|
|
def test_scripts_pass_shellcheck():
|
2018-07-03 06:05:24 +00:00
|
|
|
'''
|
|
|
|
Make sure shellcheck does not find anything wrong with our shell scripts
|
|
|
|
'''
|
|
|
|
shellcheck = ("find . -type f -name 'update.sh' "
|
|
|
|
"| while read file; do "
|
|
|
|
"shellcheck -x \"$file\" -e SC1090,SC1091; "
|
|
|
|
"done;")
|
2016-10-11 04:18:05 +00:00
|
|
|
results = run_local(shellcheck)
|
2020-03-03 07:30:44 +00:00
|
|
|
print(results.stdout)
|
2016-10-11 04:18:05 +00:00
|
|
|
assert '' == results.stdout
|