Skip to content

Commit

Permalink
Merge pull request #12196 from alanmcanonical/fix-file_owner-test
Browse files Browse the repository at this point in the history
Remove the excluded_files
  • Loading branch information
jan-cerny authored Jul 24, 2024
2 parents af2ed47 + 48e93cd commit dac1a59
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,6 @@ groupadd group_test
{{% set FIND_RECURSE_ARGS="-maxdepth 1" %}}
{{%- endif %}}

{{%- if EXCLUDED_FILES %}}
{{% set EXCLUDED_FILES_ARGS="! -name '" + EXCLUDED_FILES|join("' ! -name '") + "'" %}}
{{%- else %}}
{{% set EXCLUDED_FILES_ARGS="" %}}
{{%- endif %}}

{{% for path in FILEPATH %}}
{{% if path.endswith("/") %}}
if [ ! -d {{{ path }}} ]; then
Expand Down
8 changes: 1 addition & 7 deletions shared/templates/file_owner/tests/incorrect_owner.fail.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,13 @@ useradd testuser_123
{{% set FIND_RECURSE_ARGS="-maxdepth 1" %}}
{{%- endif %}}

{{%- if EXCLUDED_FILES %}}
{{% set EXCLUDED_FILES_ARGS="! -name '" + EXCLUDED_FILES|join("' ! -name '") + "'" %}}
{{%- else %}}
{{% set EXCLUDED_FILES_ARGS="" %}}
{{%- endif %}}

{{% for path in FILEPATH %}}
{{% if path.endswith("/") %}}
if [ ! -d {{{ path }}} ]; then
mkdir -p {{{ path }}}
fi
{{% if FILE_REGEX %}}
find -L {{{ path }}} {{{ FIND_RECURSE_ARGS }}} {{{ EXCLUDED_FILES_ARGS }}} -type f -regex '{{{ FILE_REGEX[loop.index0] }}}' -exec chown testuser_123 {} \;
find -L {{{ path }}} {{{ FIND_RECURSE_ARGS }}} -type f -regex '{{{ FILE_REGEX[loop.index0] }}}' -exec chown testuser_123 {} \;
{{% elif RECURSIVE %}}
find -L {{{ path }}} -type d -exec chown testuser_123 {} \;
{{% else %}}
Expand Down

0 comments on commit dac1a59

Please sign in to comment.