From 42fd84a35311a37ca5b3540dd8e36058014313a0 Mon Sep 17 00:00:00 2001 From: Karl Hepworth Date: Tue, 8 Feb 2022 14:12:02 +1100 Subject: [PATCH 01/14] add test for failing to load dynamic modules Signed-off-by: Karl Hepworth --- php/fpm/tests.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/php/fpm/tests.yml b/php/fpm/tests.yml index 67bc1d3..8c9be9f 100644 --- a/php/fpm/tests.yml +++ b/php/fpm/tests.yml @@ -4,3 +4,7 @@ commandTests: - name: 'check configuration' command: "sh" args: ["-c", "mkdir /data/app && php-fpm --test"] + - name: "check for unloaded modules" + command: "sh" + args: ["-c", "/usr/sbin/php-fpm", "--test"] + excludedOutput: [".*Unable to load dynamic library.*"] From 49ad6f3e6ca547878a62987717ddb610a99be33c Mon Sep 17 00:00:00 2001 From: Karl Hepworth Date: Tue, 8 Feb 2022 14:14:59 +1100 Subject: [PATCH 02/14] reorder tests Signed-off-by: Karl Hepworth --- php/fpm/tests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/php/fpm/tests.yml b/php/fpm/tests.yml index 8c9be9f..496264a 100644 --- a/php/fpm/tests.yml +++ b/php/fpm/tests.yml @@ -1,10 +1,10 @@ schemaVersion: '2.0.0' commandTests: - - name: 'check configuration' - command: "sh" - args: ["-c", "mkdir /data/app && php-fpm --test"] - name: "check for unloaded modules" command: "sh" args: ["-c", "/usr/sbin/php-fpm", "--test"] excludedOutput: [".*Unable to load dynamic library.*"] + - name: 'check configuration' + command: "sh" + args: ["-c", "mkdir /data/app && php-fpm --test"] From 73a5811b033793cca4610419d6cfcd95a3b86845 Mon Sep 17 00:00:00 2001 From: Karl Hepworth Date: Tue, 8 Feb 2022 14:18:24 +1100 Subject: [PATCH 03/14] add a -p Signed-off-by: Karl Hepworth --- php/fpm/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/php/fpm/tests.yml b/php/fpm/tests.yml index 496264a..fbd001b 100644 --- a/php/fpm/tests.yml +++ b/php/fpm/tests.yml @@ -3,8 +3,8 @@ schemaVersion: '2.0.0' commandTests: - name: "check for unloaded modules" command: "sh" - args: ["-c", "/usr/sbin/php-fpm", "--test"] + args: ["-c", "/usr/sbin/php-fpm --test"] excludedOutput: [".*Unable to load dynamic library.*"] - name: 'check configuration' command: "sh" - args: ["-c", "mkdir /data/app && php-fpm --test"] + args: ["-c", "mkdir -p /data/app && php-fpm --test"] From 023af1f78f022241dba771391ca188afd69df5a2 Mon Sep 17 00:00:00 2001 From: Karl Hepworth Date: Tue, 8 Feb 2022 14:20:36 +1100 Subject: [PATCH 04/14] switch to err Signed-off-by: Karl Hepworth --- php/fpm/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/fpm/tests.yml b/php/fpm/tests.yml index fbd001b..bec9d5f 100644 --- a/php/fpm/tests.yml +++ b/php/fpm/tests.yml @@ -4,7 +4,7 @@ commandTests: - name: "check for unloaded modules" command: "sh" args: ["-c", "/usr/sbin/php-fpm --test"] - excludedOutput: [".*Unable to load dynamic library.*"] + excludedError: [".*Unable to load dynamic library.*"] - name: 'check configuration' command: "sh" args: ["-c", "mkdir -p /data/app && php-fpm --test"] From a727595b141dc399d9f454b495837b4487f1cbd6 Mon Sep 17 00:00:00 2001 From: Karl Hepworth Date: Tue, 8 Feb 2022 14:23:15 +1100 Subject: [PATCH 05/14] adjust the test command Signed-off-by: Karl Hepworth --- php/fpm/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/php/fpm/tests.yml b/php/fpm/tests.yml index bec9d5f..08bbbe7 100644 --- a/php/fpm/tests.yml +++ b/php/fpm/tests.yml @@ -2,8 +2,8 @@ schemaVersion: '2.0.0' commandTests: - name: "check for unloaded modules" - command: "sh" - args: ["-c", "/usr/sbin/php-fpm --test"] + command: "/usr/sbin/php-fpm" + args: ["--test"] excludedError: [".*Unable to load dynamic library.*"] - name: 'check configuration' command: "sh" From 47ca1826ed47d8c224c7ef9611c34b2b1e4646ba Mon Sep 17 00:00:00 2001 From: Karl Hepworth Date: Tue, 8 Feb 2022 14:25:36 +1100 Subject: [PATCH 06/14] cut test down Signed-off-by: Karl Hepworth --- php/fpm/tests.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/php/fpm/tests.yml b/php/fpm/tests.yml index 08bbbe7..cdc8ef6 100644 --- a/php/fpm/tests.yml +++ b/php/fpm/tests.yml @@ -1,10 +1,7 @@ schemaVersion: '2.0.0' commandTests: - - name: "check for unloaded modules" - command: "/usr/sbin/php-fpm" - args: ["--test"] - excludedError: [".*Unable to load dynamic library.*"] - name: 'check configuration' command: "sh" args: ["-c", "mkdir -p /data/app && php-fpm --test"] + excludedError: [".*Unable to load dynamic library.*"] From c157373ac5ffe33261553894402806071db15600 Mon Sep 17 00:00:00 2001 From: Karl Hepworth Date: Tue, 8 Feb 2022 14:30:23 +1100 Subject: [PATCH 07/14] switch to output Signed-off-by: Karl Hepworth --- php/fpm/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/fpm/tests.yml b/php/fpm/tests.yml index cdc8ef6..4c9e469 100644 --- a/php/fpm/tests.yml +++ b/php/fpm/tests.yml @@ -4,4 +4,4 @@ commandTests: - name: 'check configuration' command: "sh" args: ["-c", "mkdir -p /data/app && php-fpm --test"] - excludedError: [".*Unable to load dynamic library.*"] + excludedOutput: [".*Unable to load dynamic library.*"] From 909a8faed82545fc7fd69f01858395c78686995f Mon Sep 17 00:00:00 2001 From: Karl Hepworth Date: Tue, 8 Feb 2022 14:36:34 +1100 Subject: [PATCH 08/14] add phpinfo call for testing Signed-off-by: Karl Hepworth --- php/fpm/tests.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/php/fpm/tests.yml b/php/fpm/tests.yml index 4c9e469..4658e96 100644 --- a/php/fpm/tests.yml +++ b/php/fpm/tests.yml @@ -1,7 +1,11 @@ schemaVersion: '2.0.0' commandTests: - - name: 'check configuration' + - name: 'check fpm configuration' command: "sh" args: ["-c", "mkdir -p /data/app && php-fpm --test"] excludedOutput: [".*Unable to load dynamic library.*"] + - name: 'check php configuration' + command: "sh" + args: ["-c", "php -r 'phpinfo();'"] + excludedOutput: [".*Unable to load dynamic library.*"] From b61c1a71c794dc0589fe156c60b2547bcaafa960 Mon Sep 17 00:00:00 2001 From: Karl Hepworth Date: Tue, 8 Feb 2022 14:49:49 +1100 Subject: [PATCH 09/14] rewrite test for modules Signed-off-by: Karl Hepworth --- php/fpm/tests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/php/fpm/tests.yml b/php/fpm/tests.yml index 4658e96..3621c3c 100644 --- a/php/fpm/tests.yml +++ b/php/fpm/tests.yml @@ -5,7 +5,7 @@ commandTests: command: "sh" args: ["-c", "mkdir -p /data/app && php-fpm --test"] excludedOutput: [".*Unable to load dynamic library.*"] - - name: 'check php configuration' + - name: 'check for unloaded modules' command: "sh" - args: ["-c", "php -r 'phpinfo();'"] - excludedOutput: [".*Unable to load dynamic library.*"] + args: ["-c", "php -r 'phpinfo();' | grep 'Unable to load dynamic library'"] + exitCode: 1 From c5d5346f802b77e49039dfadf42acce72162ec3e Mon Sep 17 00:00:00 2001 From: Karl Hepworth Date: Tue, 8 Feb 2022 15:03:09 +1100 Subject: [PATCH 10/14] rewrite test for modules Signed-off-by: Karl Hepworth --- php/fpm/tests.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/php/fpm/tests.yml b/php/fpm/tests.yml index 3621c3c..ae6b769 100644 --- a/php/fpm/tests.yml +++ b/php/fpm/tests.yml @@ -6,6 +6,8 @@ commandTests: args: ["-c", "mkdir -p /data/app && php-fpm --test"] excludedOutput: [".*Unable to load dynamic library.*"] - name: 'check for unloaded modules' - command: "sh" - args: ["-c", "php -r 'phpinfo();' | grep 'Unable to load dynamic library'"] - exitCode: 1 + command: "shell" + args: + - -c + - | + php -i | grep "Unable to load dynamic library" && false || true From 332cbc2c53546440f896e2bd81c7ae087614c544 Mon Sep 17 00:00:00 2001 From: Karl Hepworth Date: Tue, 8 Feb 2022 15:06:37 +1100 Subject: [PATCH 11/14] rewrite test for modules Signed-off-by: Karl Hepworth --- php/fpm/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/fpm/tests.yml b/php/fpm/tests.yml index ae6b769..ae6f388 100644 --- a/php/fpm/tests.yml +++ b/php/fpm/tests.yml @@ -6,7 +6,7 @@ commandTests: args: ["-c", "mkdir -p /data/app && php-fpm --test"] excludedOutput: [".*Unable to load dynamic library.*"] - name: 'check for unloaded modules' - command: "shell" + command: "sh" args: - -c - | From 98d2dca1f6a0bb72f2ceb2079c8996580da0add9 Mon Sep 17 00:00:00 2001 From: Karl Hepworth Date: Tue, 8 Feb 2022 15:29:14 +1100 Subject: [PATCH 12/14] add working tests locally Signed-off-by: Karl Hepworth --- php/fpm/tests.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/php/fpm/tests.yml b/php/fpm/tests.yml index ae6f388..0ebe5ad 100644 --- a/php/fpm/tests.yml +++ b/php/fpm/tests.yml @@ -3,11 +3,8 @@ schemaVersion: '2.0.0' commandTests: - name: 'check fpm configuration' command: "sh" - args: ["-c", "mkdir -p /data/app && php-fpm --test"] - excludedOutput: [".*Unable to load dynamic library.*"] + args: ["-c", "mkdir /data/app && php-fpm --test"] + - name: 'check for unloaded modules' command: "sh" - args: - - -c - - | - php -i | grep "Unable to load dynamic library" && false || true + args: ["-c", "php -i | grep 'Unable to load dynamic library' && false || true"] From fdf28e68972fce64b22117299a1bf7beab47a0eb Mon Sep 17 00:00:00 2001 From: Karl Hepworth Date: Tue, 8 Feb 2022 15:38:47 +1100 Subject: [PATCH 13/14] add working tests locally Signed-off-by: Karl Hepworth --- php/fpm/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/fpm/tests.yml b/php/fpm/tests.yml index 0ebe5ad..fb01452 100644 --- a/php/fpm/tests.yml +++ b/php/fpm/tests.yml @@ -7,4 +7,4 @@ commandTests: - name: 'check for unloaded modules' command: "sh" - args: ["-c", "php -i | grep 'Unable to load dynamic library' && false || true"] + args: ["-c", "php", "-i", "|", "grep", "'FAKLE'", "&&", "false", "||", "true"] From e5ef210522469f00b9f945c442288fe7dd275877 Mon Sep 17 00:00:00 2001 From: Karl Hepworth Date: Tue, 8 Feb 2022 15:39:48 +1100 Subject: [PATCH 14/14] add working tests locally Signed-off-by: Karl Hepworth --- php/fpm/tests.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/php/fpm/tests.yml b/php/fpm/tests.yml index fb01452..46cc81a 100644 --- a/php/fpm/tests.yml +++ b/php/fpm/tests.yml @@ -7,4 +7,5 @@ commandTests: - name: 'check for unloaded modules' command: "sh" - args: ["-c", "php", "-i", "|", "grep", "'FAKLE'", "&&", "false", "||", "true"] + args: ["-c", "php -i | grep 'Unable to load dynamic library'"] + exitCode: 1