Skip to content

Commit 1f5b183

Browse files
authored
add Nextcloud30 test (#60)
1 parent 47fd1da commit 1f5b183

File tree

8 files changed

+49
-39
lines changed

8 files changed

+49
-39
lines changed

CHANGELOG.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
# Changelog
22

3-
## v??.?.? (????-??-??)
3+
## v30.0.0 (2025-03-16)
44

55
* [add support for metadata format version 2.0 (#51)](https://github.com/nextcloud/encryption-recovery-tools/pull/51)
6-
* [add skip_files tests (#53)](https://github.com/nextcloud/encryption-recovery-tools/pull/53)
6+
* [add skip\_files tests (#53)](https://github.com/nextcloud/encryption-recovery-tools/pull/53)
77
* [update CHANGELOG.md (#54)](https://github.com/nextcloud/encryption-recovery-tools/pull/54)
88
* [increase decryption block size (#55)](https://github.com/nextcloud/encryption-recovery-tools/pull/55)
99
* [improve config type checks (#58)](https://github.com/nextcloud/encryption-recovery-tools/pull/58)
10+
* [add Nextcloud30 test (#60)](https://github.com/nextcloud/encryption-recovery-tools/pull/60)
1011

1112
## v29.0.0 (2024-05-31)
1213

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# encryption-recovery-tools
1+
# Nextcloud Encryption Recovery Tools
22

33
## End-to-End Encryption
44

end-to-end-encryption/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# End-to-End Encryption
1+
# Nextcloud End-to-End Encryption
22

33
## Description
44

@@ -57,4 +57,4 @@ On servers you can achieve this by starting the script within a `screen` session
5757

5858
**Windows users:**
5959
This script will **not** run on Windows.
60-
Please use the Windows Subsystem for Linux instead.
60+
Please use the Windows Subsystem for Linux instead.

end-to-end-encryption/recover.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
# ./end-to-end-encryption/recover.php
55
#
6-
# Copyright (c) 2023-2024, Yahe <[email protected]>
6+
# Copyright (c) 2023-2025, Yahe <[email protected]>
77
# Copyright (c) 2019-2023, SysEleven GmbH
88
# All rights reserved.
99
#

phpunit.sh

+26-30
Original file line numberDiff line numberDiff line change
@@ -1,113 +1,109 @@
11
#!/usr/bin/env bash
22

33
# by default we execute the end-to-end encryption tests
4-
if [[ -z "${END_TO_END_ENCRYPTION}" ]]
5-
then
4+
if [[ -z "${END_TO_END_ENCRYPTION}" ]]; then
65
END_TO_END_ENCRYPTION="1"
76
fi
87

98
# by default we execute the server-side encryption tests
10-
if [[ -z "${SERVER_SIDE_ENCRYPTION}" ]]
11-
then
9+
if [[ -z "${SERVER_SIDE_ENCRYPTION}" ]]; then
1210
SERVER_SIDE_ENCRYPTION="1"
1311
fi
1412

1513
# check if git is installed
16-
if [[ ! -x "$(command -v git)" ]]
17-
then
14+
if [[ ! -x "$(command -v git)" ]]; then
1815
echo "ERROR: git is not installed." >&2
1916
echo "ERROR: Try installing it with: brew install git" >&2
2017
exit 1
2118
fi
2219

2320
# check if php is installed
24-
if [[ ! -x "$(command -v php)" ]]
25-
then
21+
if [[ ! -x "$(command -v php)" ]]; then
2622
echo "ERROR: php is not installed." >&2
2723
echo "ERROR: Try installing it with: brew install php" >&2
2824
exit 2
2925
fi
3026

3127
# check if phpunit is installed
32-
if [[ ! -x "$(command -v phpunit)" ]]
33-
then
28+
if [[ ! -x "$(command -v phpunit)" ]]; then
3429
echo "ERROR: phpunit is not installed." >&2
3530
echo "ERROR: Try installing it with: brew install phpunit" >&2
3631
exit 3
3732
fi
3833

3934
# check if xdebug is installed
4035
XDEBUG_OUTPUT=$(php -m -c 2>/dev/null | grep --quiet Xdebug)
41-
if [[ "$?" -ne "0" ]]
42-
then
36+
if [[ "$?" -ne "0" ]]; then
4337
echo "ERROR: xdebug is not installed." >&2
4438
echo "ERROR: Try installing it with: pecl install xdebug" >&2
4539
exit 4
4640
fi
4741

48-
if [[ "${END_TO_END_ENCRYPTION}" -gt "0" ]]
49-
then
42+
if [[ "${END_TO_END_ENCRYPTION}" -gt "0" ]]; then
5043
# execute phpunit for the end-to-end encryption
5144
echo "===== END-TO-END ENCRYPTION ====="
5245
echo
5346

5447
# check if the test data repository has been checked out
5548
echo "Preparing the test data for the end-to-end encryption, this could take a while..."
56-
if [[ -d ./tests/data/end-to-end-encryption ]]
57-
then
49+
if [[ -d ./tests/data/end-to-end-encryption ]]; then
5850
git -C ./tests/data/end-to-end-encryption pull >/dev/null 2>&1
5951
else
6052
git clone https://github.com/nextcloud/end-to-end-encryption-testdata ./tests/data/end-to-end-encryption >/dev/null 2>&1
6153
fi
62-
if [[ "$?" -ne "0" ]]
63-
then
54+
if [[ "$?" -ne "0" ]]; then
6455
echo "ERROR: Preparing the test data for the end-to-end encryption failed." >&2
6556
exit 5
6657
fi
6758

6859
# separate output
6960
echo
7061

71-
XDEBUG_MODE=coverage phpunit -c ./phpunit.end-to-end-encryption.xml --coverage-html ./tests/cache/end-to-end-encryption/ --coverage-text
62+
# filter tests
63+
if [[ -n "${1}" ]]; then
64+
XDEBUG_MODE=coverage phpunit -c ./phpunit.end-to-end-encryption.xml --coverage-html ./tests/cache/end-to-end-encryption/ --coverage-text "--filter=${1}"
65+
else
66+
XDEBUG_MODE=coverage phpunit -c ./phpunit.end-to-end-encryption.xml --coverage-html ./tests/cache/end-to-end-encryption/ --coverage-text
67+
fi
7268
TEMP="$?"
7369

7470
# only proceed if no errors occured
75-
if [[ "$TEMP" -ne "0" ]]
76-
then
71+
if [[ "$TEMP" -ne "0" ]]; then
7772
echo "ERROR: error during phpunit run for the end-to-end encryption" >&2
7873
exit "$TEMP"
7974
fi
8075
fi
8176

82-
if [[ "${SERVER_SIDE_ENCRYPTION}" -gt "0" ]]
83-
then
77+
if [[ "${SERVER_SIDE_ENCRYPTION}" -gt "0" ]]; then
8478
# execute phpunit for the server-side encryption
8579
echo "===== SERVER-SIDE ENCRYPTION ====="
8680
echo
8781

8882
# check if the test data repository has been checked out
8983
echo "Preparing the test data for the server-side encryption, this could take a while..."
90-
if [[ -d ./tests/data/server-side-encryption ]]
91-
then
84+
if [[ -d ./tests/data/server-side-encryption ]]; then
9285
git -C ./tests/data/server-side-encryption pull >/dev/null 2>&1
9386
else
9487
git clone https://github.com/nextcloud/server-side-encryption-testdata ./tests/data/server-side-encryption >/dev/null 2>&1
9588
fi
96-
if [[ "$?" -ne "0" ]]
97-
then
89+
if [[ "$?" -ne "0" ]]; then
9890
echo "ERROR: Preparing the test data for the server-side encryption failed." >&2
9991
exit 6
10092
fi
10193

10294
# separate output
10395
echo
10496

105-
XDEBUG_MODE=coverage phpunit -c ./phpunit.server-side-encryption.xml --coverage-html ./tests/cache/server-side-encryption/ --coverage-text
97+
# filter tests
98+
if [[ -n "${1}" ]]; then
99+
XDEBUG_MODE=coverage phpunit -c ./phpunit.server-side-encryption.xml --coverage-html ./tests/cache/server-side-encryption/ --coverage-text "--filter=${1}"
100+
else
101+
XDEBUG_MODE=coverage phpunit -c ./phpunit.server-side-encryption.xml --coverage-html ./tests/cache/server-side-encryption/ --coverage-text
102+
fi
106103
TEMP="$?"
107104

108105
# only proceed if no errors occured
109-
if [[ "$TEMP" -ne "0" ]]
110-
then
106+
if [[ "$TEMP" -ne "0" ]]; then
111107
echo "ERROR: error during phpunit run for the server-side encryption" >&2
112108
exit "$TEMP"
113109
fi

server-side-encryption/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Server-Side Encryption
1+
# Nextcloud Server-Side Encryption
22

33
## Description
44

@@ -71,4 +71,4 @@ Also, the script currently does **not** support the decryption of files in the t
7171

7272
**Windows users:**
7373
This script will **not** run on Windows.
74-
Please use the Windows Subsystem for Linux instead.
74+
Please use the Windows Subsystem for Linux instead.

server-side-encryption/recover.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
# ./server-side-encryption/recover.php
55
#
6-
# Copyright (c) 2023-2024, Yahe <[email protected]>
6+
# Copyright (c) 2023-2025, Yahe <[email protected]>
77
# Copyright (c) 2019-2023, SysEleven GmbH
88
# All rights reserved.
99
#
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
// use prepared test setup
3+
include_once(__DIR__."/main.php");
4+
5+
final class nextcloud30 extends main {
6+
const EXTERNAL_STORAGES = [];
7+
const INSTANCEID = "ocdg3nll78ws";
8+
const RECOVERY_PASSWORD = "recovery";
9+
const SECRET = "uzF4QV35Cseak4zt3bzEbRV3suOpkc/MV3GZFV2WUH9U/xbu";
10+
const SOURCEPATHS = [];
11+
const USER_PASSWORDS = ["admin" => "admin"];
12+
const VERSION = "30.0.0";
13+
}

0 commit comments

Comments
 (0)