Skip to content

Commit

Permalink
vm-tests.yml: Fix distupgrade tests
Browse files Browse the repository at this point in the history
Signed-off-by: Tobias Knöppler <[email protected]>
  • Loading branch information
theCalcaholic committed Sep 5, 2024
1 parent 325834f commit 83153e2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/vm-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ jobs:
echo "Run integration tests"
ssh -o "StrictHostKeyChecking=no" -o "UserKnownHostsFile=/dev/null" "root@${SERVER_ADDRESS}" cat /usr/local/etc/instance.cfg
test-ncp-instance -a -f "$SNAPSHOT_ID" -b "${VERSION}" --systemtest-args "--skip-update-test" --nc-test-args "--skip-release-check" "root@${SERVER_ADDRESS}" "localhost" "8443" "9443" || {
test-ncp-instance -a -f "$SNAPSHOT_ID" -b "v1.54.3" --systemtest-args "--skip-update-test" --nc-test-args "--skip-release-check" "root@${SERVER_ADDRESS}" "localhost" "8443" "9443" || {
echo "Integration tests failed"
echo "Here are the last lines of ncp-install.log:"
Expand Down Expand Up @@ -387,7 +387,7 @@ jobs:
NC_TEST_ARGS=()
ssh "${SSH_OPTIONS[@]}" "root@${SERVER_ADDRESS}" cat /etc/os-release | grep VERSION_ID=12 || NC_TEST_ARGS+=("--skip-release-check")
set -x
test-ncp-instance -f "$SNAPSHOT_ID" -b "${VERSION}" --nc-test-args "$NC_TEST_ARGS" --systemtest-args "--skip-update-test" "root@${SERVER_ADDRESS}" "localhost" "8443" "9443" || {
test-ncp-instance -f "$SNAPSHOT_ID" -b "v1.54.3" --nc-test-args "$NC_TEST_ARGS" --systemtest-args "--skip-update-test" "root@${SERVER_ADDRESS}" "localhost" "8443" "9443" || {
echo "Integration tests failed"
echo "Here are the last lines of ncp-install.log:"
Expand Down
1 change: 0 additions & 1 deletion ncp-app/lib/Service/SettingsService.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ private function runCommand(string $cmd): array {
$stderr = stream_get_contents($pipes[2]);
fclose($pipes[2]);

$this->logger->error("STDERR: $stderr");
return [proc_close($proc), $stdout, $stderr];
}
}
Expand Down
5 changes: 5 additions & 0 deletions tests/nextcloud_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ def test_nextcloud(IP: str, nc_port: str, driver: WebDriver, skip_release_check:
version_re = re.compile(r'^(v\d+\.\d+\.\d+)$')
with (Path(__file__).parent / '../etc/ncp.cfg').open('r') as cfg_file:
ncp_cfg = json.load(cfg_file)
actual_php_version = 'unknown'
for li in list_items:
try:
inp = li.find_element(By.TAG_NAME, "input")
Expand All @@ -275,6 +276,8 @@ def test_nextcloud(IP: str, nc_port: str, driver: WebDriver, skip_release_check:
expected["notification_accounts"] = True
except:
divs = li.find_elements(By.TAG_NAME, "div")
if 'php version' in divs[0].text.lower():
actual_php_version = divs[1].text
if 'ncp version' in divs[0].text.lower() and version_re.match(divs[1].text):
expected['ncp_version'] = True
elif 'php version' in divs[0].text.lower() and divs[1].text == ncp_cfg['php_version']:
Expand All @@ -284,6 +287,8 @@ def test_nextcloud(IP: str, nc_port: str, driver: WebDriver, skip_release_check:
expected['debian_release'] = True
else:
print(f"{tc.yellow}{divs[1].text} != {ncp_cfg['release']}")
if not expected['php_version']:
print(f"php version - expected ({ncp_cfg['php_version']}) :: actual ({actual_php_version})")
failed = list(map(lambda item: item[0], filter(lambda item: not item[1], expected.items())))
test.check(len(failed) == 0, f"checks failed for admin section: [{', '.join(failed)}]")
except Exception as e:
Expand Down

0 comments on commit 83153e2

Please sign in to comment.