Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scripts/sanitycheck: fix merging OVERLAY_CONFIG extra args #21206

Commits on Jan 30, 2020

  1. scripts/sanitycheck: fix merging OVERLAY_CONFIG extra args

    Overlay files were concatenated into single string with no whitespace
    between them. If '--extra-args OVERLAY_CONFIG="overlay-1.conf"
    --extra-args OVERLAY_CONFIG="overlay-2.conf"' was used, then the result
    was OVERLAY_CONFIG="overlay-1.confoverlay-2.conf".
    
    Another thing was that overlay extra args were not properly removed from
    the list of regular arguments. As a result we had incorrect list of
    overlays and incorrect list of other arguments.
    
    Rework code to extract overlays in loop in a safe manner. Use for that a
    list of strings instead of string directly. Join those strings and form
    a single OVERLAY_CONFIG argument just before running cmake.
    
    Tested with following testcase.yaml line:
    
      extra_args: ARG1 OVERLAY_CONFIG="overlay-1.conf"
                  ARG2 OVERLAY_CONFIG="overlay-2.conf"
    
    Before this patch we got:
    
      args = ['OVERLAY_CONFIG="overlay-1.conf"',
        'OVERLAY_CONFIG="overlay-2.conf"']
    
    After this patch we get:
    
      args = ['ARG1', 'ARG2',
        'OVERLAY_CONFIG="overlay-1.conf overlay-2.conf"']
    
    While at it, fix also regex pattern by removing requirement of double
    quotes around value. Match any option value instead and strip both
    single and double quotes when match is positive. Tested with:
    
      $ ./scripts/sanitycheck -T samples/hello_world/ -p qemu_x86 \
          --extra-args OVERLAY_CONFIG=overlay1.conf '
          --extra-args OVERLAY_CONFIG=\"overlay2.conf\" '
          --extra-args OVERLAY_CONFIG=\'overlay3.conf\'
    
    Signed-off-by: Marcin Niestroj <[email protected]>
    mniestroj committed Jan 30, 2020
    Configuration menu
    Copy the full SHA
    6205111 View commit details
    Browse the repository at this point in the history