nixosTests.freshrss: improve tests
This commit is contained in:
@@ -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"
|
||||
'';
|
||||
}
|
||||
|
||||
@@ -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'")
|
||||
'';
|
||||
}
|
||||
|
||||
@@ -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."
|
||||
'';
|
||||
}
|
||||
|
||||
@@ -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"
|
||||
'';
|
||||
}
|
||||
|
||||
@@ -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"
|
||||
'';
|
||||
}
|
||||
|
||||
@@ -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"
|
||||
'';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user