diff options
| author | Mike Bonnet <mikeb@redhat.com> | 2007-12-12 18:24:40 -0500 |
|---|---|---|
| committer | Michael E Brown <michael_e_brown@dell.com> | 2007-12-12 17:31:51 -0600 |
| commit | ce084f539298d90b4930ec91d4bbdd75152b7dcb (patch) | |
| tree | fcf4d379e5557dc8299d9282c7b9b37219939c49 | |
| parent | 736bcb6dc71e3a6a82964ee7f2ca762d4b0ae465 (diff) | |
if --chroot only has one argument, pass it to doChroot() as a string instead of a list to support legacy quoting rules
Signed-off-by: Michael E Brown <michael_e_brown@dell.com>
| -rwxr-xr-x | docs/releasetests.sh | 18 | ||||
| -rwxr-xr-x | py/mock.py | 2 |
2 files changed, 20 insertions, 0 deletions
diff --git a/docs/releasetests.sh b/docs/releasetests.sh index df82523..d627bff 100755 --- a/docs/releasetests.sh +++ b/docs/releasetests.sh @@ -76,6 +76,24 @@ fi set -e # +# Test that chroot with one arg is getting passed though a shell (via os.system()) +# +time $MOCKCMD --offline --chroot 'touch /tmp/{foo,bar,baz}' +if [ ! -f $CHROOT/tmp/foo ] || [ ! -f $CHROOT/tmp/bar ] || [ ! -f $CHROOT/tmp/baz ]; then + echo "'mock --chroot' with one argument is not being passed to os.system()" + exit 1 +fi + +# +# Test that chroot with more than one arg is not getting passed through a shell +# +time $MOCKCMD --offline --chroot touch '/tmp/{quux,wibble}' +if [ ! -f $CHROOT/tmp/\{quux,wibble\} ] || [ -f $CHROOT/tmp/quux ] || [ -f $CHROOT/tmp/wibble ]; then + echo "'mock --chroot' with more than one argument is being passed to os.system()" + exit 1 +fi + +# # Test offline build # time $MOCKCMD --offline --rebuild mock-*.src.rpm @@ -482,6 +482,8 @@ def main(ret): if len(args) == 0: log.critical("You must specify a command to run") sys.exit(50) + elif len(args) == 1: + args = args[0] log.info("Running in chroot: %s" % args) chroot.tryLockBuildRoot() |
