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

CFE-3292: Removed soft fail related to the use of globs (3.21) #5555

Closed
wants to merge 8 commits into from

Conversation

craigcomstock
Copy link
Contributor

@craigcomstock craigcomstock commented Jun 26, 2024

  • Bumped libntech to commit to match glob fixes: CFE-3292: Removed soft fail related to the use of globs #5413
  • Reworked the acceptance test for findfiles_up()
  • Fixed bug related to backwards directory traversial in findfiles_up()
  • findfiles.cf: Fixed wrong assumption acceptance test
  • Added include <glob_lib.h> where needed after moving GlobFileList()
  • Added test testing square brackets in glob patterns
  • Removed soft fail for findfiles acceptance tests
  • Removed soft fail for brace support test in glob patterns

merge together:
https://github.com/cfengine/enterprise/pull/801
#5555

larsewi added 8 commits June 26, 2024 13:16
Ticket: None
Changelog: None
Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
(cherry picked from commit a95b724)
Resolved acceptance test failure on Windows caused by invalid use of
regular expressions consisting of paths with backslashes. The paths were
triggering illegal escape sequence errors in PCRE2. Recognizing the
complexity of the existing test, I opted for a complete rewrite.
Additionally, I eliminated all dependencies to facilitate a standalone
file that can easily be run on Windows.

Ticket: None
Changelog: None
Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
(cherry picked from commit 7b28b81)
The backwards directory traversial in policy function findfiles_up() did
not work properly when using forward slashes in the path argument on
Windows. Fixed this issue by changing forward slashes to backslashes in
the path argument before performing the backwards traversial.

Ticket: None
Changelog: Fixed bug related to failing backwards directory traversial
           when using forward slashes in path argument of the
           findfiles_up() policy function on Windows.
Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
(cherry picked from commit 4736ad4)
Previously the shell pattern `**` matched from one to six
subdirectories, while it should match any number of subdirectories from
zero. NorthernTechHQ/libntech#207 patrially
fixes this problem by making it match from zero to six subdirectories,
with a note to fix the limit (six) in CFE-4317. This fix caused this
acceptance test to break, as it now also include the test directory
itself (`"$(G.testdir)"`) in the actual result when testing the
`"$(G.testdir)/**"` shell pattern. It was easily fixed by modifying the
shell pattern to `"$(G.testdir)/*/**"`.

Ticket: None
Changelog: None
Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
(cherry picked from commit 710985e)

 Conflicts:
	tests/acceptance/01_vars/02_functions/findfiles.cf

Some different changes here. Tried my best to merge.
Ticket: None
Changelog: None
Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
(cherry picked from commit e86b4d2)
Ticket: None
Changelog: None
Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
(cherry picked from commit c803201)
Also needed to make same changes in order for it to work on Windows.

Ticket: None
Changelog: None
Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
(cherry picked from commit d60340f)

 Conflicts:
	tests/acceptance/01_vars/02_functions/findfiles.cf
Ticket: CFE-3292
Changelog: None
Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
(cherry picked from commit 7a3c2dc)
@cf-bottom
Copy link

Thank you for submitting a pull request! Maybe @larsewi can review this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants