• Lucas Bates's avatar
    tc-testing: Correct compound statements for namespace execution · cd464197
    Lucas Bates authored
    If tdc is executing test cases inside a namespace, only the
    first command in a compound statement will be executed inside
    the namespace by tdc. As a result, the subsequent commands
    are not executed inside the namespace and the test will fail.
    
    Example:
    
    for i in {x..y}; do args="foo"; done && tc actions add $args
    
    The namespace execution feature will prepend 'ip netns exec'
    to the command:
    
    ip netns exec tcut for i in {x..y}; do args="foo"; done && \
      tc actions add $args
    
    So the actual tc command is not parsed by the shell as being
    part of the namespace execution.
    
    Enclosing these compound statements inside a bash invocation
    with proper escape characters resolves the problem by creating
    a subshell inside the namespace.
    Signed-off-by: default avatarLucas Bates <lucasb@mojatatu.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    cd464197
gact.json 15.1 KB