902821e ipatests: Allow zero-length arguments

2 files Authored by slev 4 years ago, Committed by abbra 4 years ago,
    ipatests: Allow zero-length arguments
    
    Currently, such arguments are eaten by 'ipa-run-tests' script as they
    are not quoted.
    
    For example, running ipa-run-tests -k ''
    results in the actual invocation would be like as:
    ['/bin/sh',
     '--norc',
     '--noprofile',
     '-c',
     '--',
     "/usr/bin/python3 -c 'import sys,pytest;sys.exit(pytest.main())' -o "
     'cache_dir=/tmp/pytest-of-root/pytest-12/test_ipa_run_tests_empty_expression0/.pytest_cache '
     '--confcutdir=/usr/lib64/python3/site-packages/ipatests -k ']
    
    Note: expressions or marks could be empty as a result of the building
    of command line args by more high-level tools, scripts, etc.
    
    So, a short-termed solution is the quotting of zero-length arguments.
    
    Fixes: https://pagure.io/freeipa/issue/8173
    Signed-off-by: Stanislav Levin <slev@altlinux.org>
    Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
    
        
file modified
+4 -1