nixosTests.freshrss: improve tests

This commit is contained in:
Felix Buehler
2025-12-28 20:53:05 +01:00
parent 9add9fd23c
commit 84e6934ef3
6 changed files with 10 additions and 9 deletions
+1 -1
View File
@@ -22,7 +22,7 @@
testScript = ''
machine.wait_for_unit("multi-user.target")
machine.wait_for_open_port(80)
response = machine.succeed("curl -vvv -s -H 'Host: freshrss' http://localhost:80/i/")
response = machine.succeed("curl --fail-with-body --silent --header 'Host: freshrss' http://localhost:80/i/")
assert '<title>Login · FreshRSS</title>' in response, "Login page didn't load successfully"
'';
}
+5 -4
View File
@@ -20,17 +20,18 @@
];
testScript = ''
from lxml import etree
machine.wait_for_unit("multi-user.target")
machine.wait_for_open_port(80)
response = machine.succeed("curl -s http://localhost:80/i/?c=extension")
response = machine.succeed("curl --fail-with-body --silent http://localhost:80/i/?c=extension")
assert '<span class="ext_name disabled">YouTube Video Feed</span>' in response, "Extension not present in extensions page."
# enable Title-Wrap extension
from lxml import etree
tree = etree.HTML(response)
csrf = tree.xpath("/html/body/header/nav/form/input/@value")[0]
response = machine.succeed(f"curl --fail-with-body -s 'http://localhost:80/i/?c=extension&a=enable&e=Title-Wrap' -d '_csrf={csrf}'")
machine.succeed(f"curl --fail-with-body --silent 'http://localhost:80/i/?c=extension&a=enable&e=Title-Wrap' -d '_csrf={csrf}'")
# verify that the Title-Wrap css is accessible.
machine.succeed("curl --fail-with-body -s 'http://localhost:80/ext.php?1=&f=xExtension-TitleWrap/static/title_wrap.css'")
machine.succeed("curl --fail-with-body --silent 'http://localhost:80/ext.php?1=&f=xExtension-TitleWrap/static/title_wrap.css'")
'';
}
+1 -1
View File
@@ -15,7 +15,7 @@
testScript = ''
machine.wait_for_unit("multi-user.target")
machine.wait_for_open_port(80)
response = machine.succeed("curl -vvv -s -H 'Host: freshrss' -H 'Remote-User: testuser' http://localhost:80/i/")
response = machine.succeed("curl --fail-with-body --silent -H 'Remote-User: testuser' http://localhost:80/i/")
assert 'Account: testuser' in response, "http_auth method didn't work."
'';
}
+1 -1
View File
@@ -20,7 +20,7 @@
testScript = ''
machine.wait_for_unit("multi-user.target")
machine.wait_for_open_port(80)
response = machine.succeed("curl -vvv -s -H 'Host: freshrss' http://localhost:80/i/")
response = machine.succeed("curl --fail-with-body --silent http://localhost:80/i/")
assert '<title>Login · FreshRSS</title>' in response, "Login page didn't load successfully"
'';
}
+1 -1
View File
@@ -14,7 +14,7 @@
testScript = ''
machine.wait_for_unit("multi-user.target")
machine.wait_for_open_port(80)
response = machine.succeed("curl -vvv -s http://localhost:80/i/")
response = machine.succeed("curl --fail-with-body --silent http://localhost:80/i/")
assert '<title> · FreshRSS</title>' in response, "FreshRSS stream page didn't load successfully"
'';
}
+1 -1
View File
@@ -46,7 +46,7 @@
machine.wait_for_unit("multi-user.target")
machine.wait_for_open_port(5432)
machine.wait_for_open_port(80)
response = machine.succeed("curl -vvv -s -H 'Host: freshrss' http://localhost:80/i/")
response = machine.succeed("curl --fail-with-body --silent http://localhost:80/i/")
assert '<title>Login · FreshRSS</title>' in response, "Login page didn't load successfully"
'';
}