[master 1/3] Add more tests to proxy-kickstart
dashea
installerbot-noreply at redhat.com
Mon Aug 3 20:29:30 UTC 2015
All the ones that aren't [[ ]] are checking the return value of grep, it's just that some greps are more buried than others.
Maybe it would be better to split them all out into separate conditionals, and split it up to run the grep command, and then check the return code? Something like:
```
# Look for the proxy setting in the repo file
grep -q 'proxy=http://127.0.0.1:8080' $ANA_INSTALL_PATH/etc/yum.repos.d/kstest-http.repo
if [[ $? != 0 ]]; then
echo "kstest-http.repo does not contain proxy information" >> $ANA_INSTALL_PATH/root/RESULT
fi
# Check that the installed repo file is usable
chroot $ANA_INSTALL_PATH dnf --disablerepo=\* --enablerepo=kstest-http --quiet repoquery testpkg-http-core 2>/dev/null | grep -q 'testpkg-http-core'
if [[ $? != 0 ]]; then
echo "unable to query kstest-http repo' >> $ANA_INSTALL_PATH/root/RESULT
fi
```
and so forth. The lazy way I just wrote right there might output more to /root/RESULT, but if only the first line gets used anyway it shouldn't really matter.
--
To view this comment on github, visit https://github.com/dashea/anaconda/commit/a3810f0a30a796f1a81784dd4d5f330844cf73ab#commitcomment-12501832
More information about the anaconda-patches
mailing list