Add functional tests:
- User of git-access group can access gitweb site.
- User not of git-access group can't access gitweb site.
Tested that all the gitweb app tests pass.
Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
- Do not require a user password when creating a user. Generate a password
if not provided.
- Before creating a user, delete previous user with the same name.
- Delete user: Do not skip if the user doesn't exist. It avoids the
situation that some @when tests may silently skip.
- Update openvpn and deluge functional tests assuming passwords were not
under the tests.
Tests performed:
- users, openvpn and deluge app functional tests pass.
Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Add './container ip' command to print current IP address of the container.
Useful when running container related scripts on host machine.
Signed-off-by: Veiko Aasa <veiko17@disroot.org>
ldapsearch is provided by ldap-utils, which is not a build dependency.
Test: Build package using `gbp buildpackage`.
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- Add new subcommand `run-tests` to the ./container script and the --pytest-args
argument to pass additional arguments to the pytest command.
- Runs tests as root.
- Add new parameters to the SSH command:
- -Y Enable X11 forwarding to be able to run a browser GUI on a container.
- -C Use traffic compression so the X11 GUI is not laggy.
- -t Force pseudo-terminal allocation to enable colors on terminal.
- Use the LogLevel=error option to suppress some warning messages.
- Update module markers in the pytest.ini file.
- Increase the default container disk size to 12G.
- Update HACKING.md to run unit and functional tests.
PROVISION_SCRIPT:
- Explicitly install sshpass as requirement for tests, needed on Debian
stable.
- Ensure that geckodriver.log and .pytest_cache/ exist and are others-writable.
Closes#1901
Tests performed:
- Run unit tests on stable, testing and unstable containers, no failed tests.
- Run functional tests on stable and testing containers, no regressions.
[ fioddor: Some failing tests. All of them unrelated to the changes
introduced. Impact restricted to development tools; the product
hasn't been changed.]
Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: Fioddor Superconcentrado <fioddor@gmail.com>
- On Debian 10, pin pytest-bdd version to 3.2.1, this is the latest
version that supports pytest 3.10.1.
- Install wheel and pytest-xdist packages from the Debian repos.
- Add git as a dependency for functional tests.
- Fix regexp when getting Gecko version from the Github api, for some
reason after colon, sometimes there is a space and sometimes not.
Tests performed on Debian stable, testing and unstable:
- Installing dependencies with the install.sh script succeeds.
- No regressions when running tests.
Signed-off-by: Veiko Aasa <veiko17@disroot.org>
- Also, make sure an admin account exists before some tests.
Tests performed:
- The users module test_actions unit tests are skipped if LDAP is not set up.
- The users module unit tests pass if LDAP is set up.
Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Perhaps the configuration was earlier stored under /var and symlinked from /etc/
but currently it is a separate directory and needs to be backed up.
Tests:
- Run functional tests for the radicale.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- Each app does not have to call the validator by itself.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- Component performs the validation instead of each app calling the validator.
- Retain the schema for declaring backup information.
- Suitable for usage directly in the backup/restore operation packets instead of
using BackupApp class.
- Backup/restore hooks can be handled by overriding this component instead of
module level methods.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- So that with a component at hand, it's app can be easily retrieved.
- Don't create circular dependencies.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
The running status prevents the user from downloading the profile a second time.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
Opening a new window is simply unnecessary.
Tests:
- Clicking the link will result in immediate download in Chrome without
navigating away from the page.
- Clicking the link will result in download prompt in Firefox without navigating
away from the page.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
Fixes#1894
Tests performed:
- All the ejabberd tests pass on both Debian testing and stable
Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
- In pytest-bdd v4.0, given steps are no longer fixtures. Mark steps
as fixtures when needed.
- Remove 'test_' prefix from step function names, so that pytest doesn't
run those twice.
Test performed:
- Run all tests, no more pytest-bdd v4.0 related failures
- All the openvpn, snapshot and users module tests pass
Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
When 'restrict console logins' is activated, debsecan hourly cron jobs fail
because the 'daemon' user is not allowed to run cron jobs. Add rule to the
login access control file to allow 'daemon' user to run cron jobs.
Fixes#1770
Tested that after I copied the file to /etc/security/access.d/10freedombox-security.conf,
there are no more debsecan cron job errors in the journalctl logs.
Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: Fioddor Superconcentrado <fioddor@gmail.com>
Fixes#2000
Tests performed:
- All the users module tests pass
- Create a user, add the user to the freedombox-share group,
check that the user can connect to the Samba Group share.
Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
When FreedomBox package is installed on a fresh Debian machine where a
snakeoil certificate doesn't exist, generate a new one.
Fixes#1923Fixes#1999
Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
[Veiko: Made added code comment more precise]
Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
Add tests to check that usage of Deluge is only permitted to users in
the group 'bit-torrent'.
Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>