Skip to content

Commit

Permalink
Convert win lineendings to Unix for tests which need it on Windows
Browse files Browse the repository at this point in the history
Also install dos2unix for this and remove cf-secret workaround, since we
package it now

Ticket: ENT-10433

Changelog: none
  • Loading branch information
Aleksei Shpakovskii committed Jul 27, 2023
1 parent 1c93e72 commit 9a9d10d
Show file tree
Hide file tree
Showing 12 changed files with 43 additions and 3 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/windows_acceptance_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jobs:
- uses: msys2/setup-msys2@v2
with:
install: >-
dos2unix
diffutils
util-linux
python-pip
Expand Down Expand Up @@ -46,9 +47,6 @@ jobs:
- name: run cf-agent
run: "'/c/Program Files/Cfengine/bin/cf-agent.exe' --version"

- name: dummy cf-secret, ENT-10405
run: "touch 'c:/Program Files/Cfengine/bin/cf-secret.exe' && chmod a+x 'c:/Program Files/Cfengine/bin/cf-secret.exe'"

- name: expect an unknown synthax error in packagesmatching.cf, ENT-10422
run: "cd tests/acceptance/01_vars/02_functions/ && mv packagesmatching.cf packagesmatching.x.cf"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ bundle agent __main__
"bundlesequence" usebundle => default("$(this.promise_filename)");
}

bundle agent init
{
commands:
windows::
"$(G.dos2unix) $(this.promise_dirname)/expected_output.txt" -> { "ENT-10433" };
}

bundle agent test
{
meta:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ bundle agent __main__
"bundlesequence" usebundle => default("$(this.promise_filename)");
}

bundle agent init
{
commands:
windows::
"$(G.dos2unix) $(this.promise_dirname)/expected_output.txt" -> { "ENT-10433" };
}

bundle agent test
{
meta:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ body common control

bundle agent init
{
commands:
windows::
"$(G.dos2unix) $(this.promise_filename).expected" -> { "ENT-10433" };

files:
"$(G.testdir)/actual.txt"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ bundle agent init
vars:
"autorun" slist => bundlesmatching(".*", "autorun");

commands:
windows::
"$(G.dos2unix) $(this.promise_filename).expected" -> { "ENT-10433" };

files:
"$(G.testfile)"
edit_line => empty;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ bundle agent init
vars:
"autorun" slist => bundlesmatching(".*", "autorun");

commands:
windows::
"$(G.dos2unix) $(this.promise_filename).expected" -> { "ENT-10433" };

files:
"$(G.testfile)"
edit_line => empty;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ bundle agent init
meta:
"tags" slist => { "find" };

commands:
windows::
"$(G.dos2unix) $(this.promise_filename).expected" -> { "ENT-10433" };

vars:
# We want to be sure we can reference this data subsequently
"d" data => parsejson( '{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ bundle agent init
{
meta:
"tags" slist => { "find" };
commands:
windows::
"$(G.dos2unix) $(this.promise_filename).expected" -> { "ENT-10433" };

}

bundle agent test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ bundle agent check
classes:
"passed" expression => strcmp("$(test.expected)", "$(test.actual)");
reports:
windows::
"$(this.promise_filename) SFAIL/ENT-10433";
DEBUG::
"Expected: '$(test.expected)'";
"Found: '$(test.actual)'";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ bundle agent check
classes:
"passed" expression => strcmp("$(test.expected)", "$(test.actual)");
reports:
windows::
"$(this.promise_filename) SFAIL/ENT-10433";
DEBUG::
"Expected: '$(test.expected)'";
"Found: '$(test.actual)'";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ body common control

bundle agent init
{
commands:
windows::
"$(G.dos2unix) $(this.promise_filename).expected.txt" -> { "ENT-10433" };

files:
"$(G.testdir)/reports.txt"
delete => tidy;
Expand Down
1 change: 1 addition & 0 deletions tests/acceptance/dcs.cf.sub
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ bundle common G
# General commands.
"cmds" slist => { "date",
"dd",
"dos2unix",
"diff",
"cat",
"colordiff",
Expand Down

0 comments on commit 9a9d10d

Please sign in to comment.