Skip to content

Commit 3edd836

Browse files
committed
test: run coreAPI3 pipeline over k8s
Signed-off-by: Ashim Shrestha <[email protected]>
1 parent cf3f5cb commit 3edd836

File tree

3 files changed

+38
-27
lines changed

3 files changed

+38
-27
lines changed

.drone.star

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,7 @@ config = {
318318
],
319319
"skip": False,
320320
"withRemotePhp": [False],
321+
"k8s": True,
321322
},
322323
"4": {
323324
"suites": [
@@ -1092,7 +1093,7 @@ def localApiTestPipeline(ctx):
10921093
params[item] = matrix[item] if item in matrix else defaults[item]
10931094
for storage in params["storages"]:
10941095
for run_with_remote_php in params["withRemotePhp"]:
1095-
run_on_k8s = params["k8s"] and ctx.build.event == "cron"
1096+
run_on_k8s = params["k8s"]
10961097
ocis_url = OCIS_URL
10971098
if run_on_k8s:
10981099
ocis_url = "https://%s" % OCIS_SERVER_NAME
@@ -1394,7 +1395,7 @@ def coreApiTestPipeline(ctx):
13941395
for run_with_remote_php in params["withRemotePhp"]:
13951396
filter_tags = "~@skipOnGraph&&~@skipOnOcis-%s-Storage" % ("OC" if storage == "owncloud" else "OCIS")
13961397
expected_failures_file = "%s/expected-failures-API-on-%s-storage.md" % (test_dir, storage.upper())
1397-
run_on_k8s = params["k8s"] and ctx.build.event == "cron"
1398+
run_on_k8s = params["k8s"]
13981399
ocis_url = OCIS_URL
13991400
if run_on_k8s:
14001401
ocis_url = "https://%s" % OCIS_SERVER_NAME

tests/acceptance/bootstrap/OcisConfigContext.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ public function theConfigHasBeenSetToValue(TableNode $table): void {
267267
$envs = [];
268268
if (getenv("K8S") === "true") {
269269
foreach ($table->getHash() as $row) {
270-
$envs[$row['service']] = [$row['config'] => $row['value']];
270+
$envs[$row['service']][$row['config']] = $row['value'];
271271
}
272272
$response = OcisConfigHelper::reConfigureOcisK8s($envs);
273273
} else {

tests/acceptance/features/coreApiSharePublicLink2/enforcePasswordPublicLink.feature

Lines changed: 34 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,10 @@ Feature: enforce password on public link
3636
Scenario Outline: create a public link with viewer permission without a password when enforce-password is enabled
3737
Given the following configs have been set:
3838
| service | config | value |
39-
| sharing | OCIS_SHARING_PUBLIC_SHARE_MUST_HAVE_PASSWORD | false |
40-
| sharing | OCIS_SHARING_PUBLIC_WRITEABLE_SHARE_MUST_HAVE_PASSWORD | true |
39+
| sharing | SHARING_PUBLIC_SHARE_MUST_HAVE_PASSWORD | false |
40+
| sharing | SHARING_PUBLIC_WRITEABLE_SHARE_MUST_HAVE_PASSWORD | true |
41+
| frontend | OCIS_SHARING_PUBLIC_SHARE_MUST_HAVE_PASSWORD | false |
42+
| frontend | OCIS_SHARING_PUBLIC_WRITEABLE_SHARE_MUST_HAVE_PASSWORD | true |
4143
And user "Alice" has been created with default attributes
4244
And user "Alice" has uploaded file with content "test file" to "/testfile.txt"
4345
And using OCS API version "<ocs-api-version>"
@@ -57,6 +59,8 @@ Feature: enforce password on public link
5759
| service | config | value |
5860
| sharing | SHARING_PUBLIC_SHARE_MUST_HAVE_PASSWORD | false |
5961
| sharing | SHARING_PUBLIC_WRITEABLE_SHARE_MUST_HAVE_PASSWORD | true |
62+
| frontend | OCIS_SHARING_PUBLIC_SHARE_MUST_HAVE_PASSWORD | false |
63+
| frontend | OCIS_SHARING_PUBLIC_WRITEABLE_SHARE_MUST_HAVE_PASSWORD | true |
6064
And user "Alice" has been created with default attributes
6165
And user "Alice" has uploaded file with content "test file" to "/testfile.txt"
6266
And using OCS API version "<ocs-api-version>"
@@ -179,14 +183,19 @@ Feature: enforce password on public link
179183

180184
Scenario Outline: try to update a public link with a password that does not comply with the password policy
181185
Given the following configs have been set:
182-
| service | config | value |
183-
| sharing | OCIS_SHARING_PUBLIC_SHARE_MUST_HAVE_PASSWORD | false |
184-
| sharing | OCIS_SHARING_PUBLIC_WRITEABLE_SHARE_MUST_HAVE_PASSWORD | true |
185-
| sharing | OCIS_PASSWORD_POLICY_MIN_CHARACTERS | 13 |
186-
| sharing | OCIS_PASSWORD_POLICY_MIN_LOWERCASE_CHARACTERS | 3 |
187-
| sharing | OCIS_PASSWORD_POLICY_MIN_UPPERCASE_CHARACTERS | 2 |
188-
| sharing | OCIS_PASSWORD_POLICY_MIN_DIGITS | 1 |
189-
| sharing | OCIS_PASSWORD_POLICY_MIN_SPECIAL_CHARACTERS | 2 |
186+
| service | config | value |
187+
| sharing | SHARING_PUBLIC_SHARE_MUST_HAVE_PASSWORD | false |
188+
| sharing | SHARING_PUBLIC_WRITEABLE_SHARE_MUST_HAVE_PASSWORD | true |
189+
| sharing | SHARING_PASSWORD_POLICY_MIN_CHARACTERS | 13 |
190+
| sharing | SHARING_PASSWORD_POLICY_MIN_LOWERCASE_CHARACTERS | 3 |
191+
| sharing | SHARING_PASSWORD_POLICY_MIN_UPPERCASE_CHARACTERS | 2 |
192+
| sharing | SHARING_PASSWORD_POLICY_MIN_DIGITS | 1 |
193+
| sharing | SHARING_PASSWORD_POLICY_MIN_SPECIAL_CHARACTERS | 2 |
194+
| frontend | FRONTEND_PASSWORD_POLICY_MIN_CHARACTERS | 13 |
195+
| frontend | FRONTEND_PASSWORD_POLICY_MIN_LOWERCASE_CHARACTERS | 3 |
196+
| frontend | FRONTEND_PASSWORD_POLICY_MIN_UPPERCASE_CHARACTERS | 2 |
197+
| frontend | FRONTEND_PASSWORD_POLICY_MIN_DIGITS | 1 |
198+
| frontend | FRONTEND_PASSWORD_POLICY_MIN_SPECIAL_CHARACTERS | 2 |
190199
And user "Alice" has been created with default attributes
191200
And user "Alice" has uploaded file with content "test file" to "/testfile.txt"
192201
And using OCS API version "<ocs-api-version>"
@@ -215,7 +224,8 @@ Feature: enforce password on public link
215224

216225

217226
Scenario Outline: create a public link with a password in accordance with the password policy (valid cases)
218-
Given the config "<config>" has been set to "<config-value>" for "<service>" service
227+
Given the config "<frontend-config>" has been set to "<config-value>" for "frontend" service
228+
And the config "<config>" has been set to "<config-value>" for "<service>" service
219229
And using OCS API version "2"
220230
And user "Alice" has been created with default attributes
221231
And user "Alice" has uploaded file with content "test file" to "/testfile.txt"
@@ -230,15 +240,15 @@ Feature: enforce password on public link
230240
And the public should not be able to download file "/testfile.txt" from inside the last public link shared folder using the public WebDAV API with password "wrong pass"
231241
But the public should be able to download file "/testfile.txt" from inside the last public link shared folder using the public WebDAV API with password "<password>"
232242
Examples:
233-
| service | config | config-value | password |
234-
| sharing | OCIS_PASSWORD_POLICY_MIN_CHARACTERS | 4 | Ps-1 |
235-
| sharing | SHARING_PASSWORD_POLICY_MIN_CHARACTERS | 14 | Ps1:with space |
236-
| sharing | SHARING_PASSWORD_POLICY_MIN_LOWERCASE_CHARACTERS | 4 | PS1:test |
237-
| sharing | SHARING_PASSWORD_POLICY_MIN_UPPERCASE_CHARACTERS | 3 | PS1:TeƒsT |
238-
| sharing | SHARING_PASSWORD_POLICY_MIN_DIGITS | 2 | PS1:test2 |
239-
| sharing | SHARING_PASSWORD_POLICY_MIN_SPECIAL_CHARACTERS | 2 | PS1:test pass |
240-
| sharing | SHARING_PASSWORD_POLICY_MIN_SPECIAL_CHARACTERS | 33 | pS1! #$%&'()*+,-./:;<=>?@[\]^_`{ }~ |
241-
| sharing | SHARING_PASSWORD_POLICY_MIN_SPECIAL_CHARACTERS | 5 | 1sameCharacterShouldWork!!!!! |
243+
| service | config | config-value | password | frontend-config |
244+
| sharing | OCIS_PASSWORD_POLICY_MIN_CHARACTERS | 4 | Ps-1 | FRONTEND_PASSWORD_POLICY_MIN_CHARACTERS |
245+
| sharing | SHARING_PASSWORD_POLICY_MIN_CHARACTERS | 14 | Ps1:with space | FRONTEND_PASSWORD_POLICY_MIN_CHARACTERS |
246+
| sharing | SHARING_PASSWORD_POLICY_MIN_LOWERCASE_CHARACTERS | 4 | PS1:test | FRONTEND_PASSWORD_POLICY_MIN_LOWERCASE_CHARACTERS |
247+
| sharing | SHARING_PASSWORD_POLICY_MIN_UPPERCASE_CHARACTERS | 3 | PS1:TeƒsT | FRONTEND_PASSWORD_POLICY_MIN_LOWERCASE_CHARACTERS |
248+
| sharing | SHARING_PASSWORD_POLICY_MIN_DIGITS | 2 | PS1:test2 | FRONTEND_PASSWORD_POLICY_MIN_DIGITS |
249+
| sharing | SHARING_PASSWORD_POLICY_MIN_SPECIAL_CHARACTERS | 2 | PS1:test pass | FRONTEND_PASSWORD_POLICY_MIN_SPECIAL_CHARACTERS |
250+
| sharing | SHARING_PASSWORD_POLICY_MIN_SPECIAL_CHARACTERS | 33 | pS1! #$%&'()*+,-./:;<=>?@[\]^_`{ }~ | FRONTEND_PASSWORD_POLICY_MIN_SPECIAL_CHARACTERS |
251+
| sharing | SHARING_PASSWORD_POLICY_MIN_SPECIAL_CHARACTERS | 5 | 1sameCharacterShouldWork!!!!! | FRONTEND_PASSWORD_POLICY_MIN_SPECIAL_CHARACTERS |
242252

243253

244254
Scenario Outline: try to create a public link with a password that does not comply with the password policy (invalid cases)
@@ -261,8 +271,8 @@ Feature: enforce password on public link
261271

262272

263273
Scenario Outline: update a public link with a password that is listed in the Banned-Password-List
264-
Given the config "SHARING_PASSWORD_POLICY_BANNED_PASSWORDS_LIST" has been set to path "config/drone/banned-password-list.txt" for "sharing" service
265-
And the config "FRONTEND_PASSWORD_POLICY_BANNED_PASSWORDS_LIST" has been set to path "config/drone/banned-password-list.txt" for "frontend" service
274+
Given the config "SHARING_PASSWORD_POLICY_BANNED_PASSWORDS_LIST" has been set to path "/etc/ocis/banned-password-list.txt" for "sharing" service
275+
And the config "FRONTEND_PASSWORD_POLICY_BANNED_PASSWORDS_LIST" has been set to path "/etc/ocis/banned-password-list.txt" for "frontend" service
266276
And using OCS API version "2"
267277
And user "Alice" has been created with default attributes
268278
And user "Alice" has uploaded file with content "test file" to "/testfile.txt"
@@ -285,8 +295,8 @@ Feature: enforce password on public link
285295

286296

287297
Scenario Outline: create a public link with a password that is listed in the Banned-Password-List
288-
Given the config "SHARING_PASSWORD_POLICY_BANNED_PASSWORDS_LIST" has been set to path "config/drone/banned-password-list.txt" for "sharing" service
289-
And the config "FRONTEND_PASSWORD_POLICY_BANNED_PASSWORDS_LIST" has been set to path "config/drone/banned-password-list.txt" for "frontend" service
298+
Given the config "SHARING_PASSWORD_POLICY_BANNED_PASSWORDS_LIST" has been set to path "/etc/ocis/banned-password-list.txt" for "sharing" service
299+
And the config "FRONTEND_PASSWORD_POLICY_BANNED_PASSWORDS_LIST" has been set to path "/etc/ocis/banned-password-list.txt" for "frontend" service
290300
And using OCS API version "2"
291301
And user "Alice" has been created with default attributes
292302
And user "Alice" has uploaded file with content "test file" to "/testfile.txt"

0 commit comments

Comments
 (0)