-
-
Notifications
You must be signed in to change notification settings - Fork 216
Smoke Tests
First, install the snap:
$ sudo snap install --candidate nextcloud
- Open http://localhost in the browser.
- Check that the Nextcloud page to create an admin account is opened.
- Enter admin credentials.
- You should see a popup mentioning the sync tools. Close it, and you should see the default file scaffold (user's guide, etc.).
- Open the admin dropdown from the top-right corner.
- Select the
Users
option.- The Users page is opened.
- Click the
Add Group
button. - Enter the $GROUP_NAME.
- Click the
+
button.- The group is added to the list.
- On the users page, enter the $USERNAME and $PASSWORD.
- Select the $GROUP_NAME from the group drop down.
- Click the
Create
button.- The user is added to the list.
- Open the main dropdown from the top-right corner.
- Select the
Apps
option.- The Apps page is opened.
- Click the
Not enabled
option. - Click the
Enable
button of theDefault encryption module
.- The text of the button is now
Disable
.
- The text of the button is now
- Log out and log in again to initialize the keys.
- Open the admin dropdown from the top-right corner.
- Select the
Admin
option.- The Admin page is opened.
- Go to the
Server-side encryption
section. - Click the
Enable encryption
button.- The option has a check and the defaylt encryption module options are shown.
The Nextcloud snap doesn't support using sendmail as Nextcloud has it hard-coded. You can only complete this test if you have an SMTP server you can use.
- Open the admin dropdown from the top-right corner.
- Select the
Personal
option.- The Personal page is opened.
- Enter your $USER_EMAIL.
- Open again the admin dropdown.
- Select the
Admin
option.- The Admin page is opened.
- Go to the Email server section.
- Fill out your SMTP information
- Enter the
From address
. - Click the
Send email
button. - Go to your email client and check the received email.
- Log out and on the login page, enter the $USERNAME and $PASSWORD.
- Click the button with right arrow.
- The files page is opened, with a dialog to get applications to sync.
- Close the dialog.
-
On the files page, click the
+
button. -
Click the
Text file
option. -
Enter the $FILE_NAME.
- A dialog is opened to edit the file.
-
Enter some text.
-
Wait for the file to be saved.
-
Close the dialog.
- The file is added to the list.
-
Click the created file.
- The dialog is open to edit the file. It contains the text written before.
-
Open a terminal to check that the file is encrypted:
$ sudo cat /var/snap/nextcloud/common/nextcloud/data/testuser/files/test.txt
- The contents displayed are encrypted.
- On the files page, click the
+
button. - Click the
Folder
option. - Enter the $FOLDER_NAME
- Press enter.
- The folder is added to the list.
- Click the folder.
- The folder contents are shown, it's empty.
- On the files page, click the
+
button. - Click the
Upload
option.- The file selection dialog is opened.
- Select a file.
- A progress bar is shown during the upload.
- The file is added to the list.
- Click the file and check that it's the same you uploaded.
- On the files page, click the
...
button next to a file. - Click the
Delete
option.- The file is removed from the list.
- Click the
Deleted files
button on the bottom-left corner.- The deleted file appears in the list.
- On the deleted files page, click the
Restore
button next to a file.- The file is removed from the list.
- Go to
All files
. - Navigate to the folder that used to contain the file.
- The restored file appears in the list.
There are three variants of this: using self-signed certificates, using custom (gotten from elsewhere) certificates, and using Let's Encrypt. Test as many as you can, but note that Let's Encrypt requires a service with a public IP, and ports 80 and 443 open with a domain name pointing to it.
Note that these tests should be run in a private browser window, each in its own window, or the browser will cache HTTPS being enabled, which makes it annoying to disable it to test something else.
-
Enable HTTPS requesting self-signed certificates:
$ sudo nextcloud.enable-https self-signed
-
Verify that HTTP redirects to HTTPS.
-
Verify that you get a certificate warning due to the certificate's self-signed nature.
-
Verify that HTTPS can be successfully disabled:
$ sudo nextcloud.disable-https
-
Generate your own self-signed certificate and key:
$ openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365 -nodes
-
Place the key and cert into some place accessible by the snap (e.g.
$SNAP_COMMON
or$SNAP_DATA
):$ sudo mv *.pem /var/snap/nextcloud/common/
-
Enable HTTPS in the snap and tell it to use the cert/key you just created:
$ cd /var/snap/nextcloud/common $ sudo nextcloud.enable-https custom cert.pem key.pem cert.pem
-
Verify that HTTP redirects to HTTPS.
-
Verify that you get a certificate warning due to the certificate's self-signed nature.
-
Verify that HTTPS can be successfully disabled:
$ sudo nextcloud.disable-https
-
Enable HTTPS requesting certificates from Let's Encrypt (note that Let's Encrypt limits the number of real certificates you can obtain in a given week. If you've hit that limit, use the
-t
option to obtain a certificate from their staging server instead):$ sudo nextcloud.enable-https lets-encrypt
-
Verify that HTTP redirects to HTTPS.
-
Verify that you don't get a warning in the browser (unless you used
-t
). -
Verify that HTTPS can be successfully disabled:
$ sudo nextcloud.disable-https
- Add a samba share via External Storage.
- Verify that files can be downloaded/uploaded from the Samba share.
By default the snap listens on port 80. If you enabled HTTPS, it also listens on port 443, and redirects HTTP traffic to HTTPS.
Start these tests with HTTPS disabled.
- Run
sudo snap get nextcloud ports
- You should see a JSON dump showing ports 80 and 443.
-
Change the HTTP port to port 81:
$ sudo snap set nextcloud ports.http=81
-
Visit http://localhost again, and verify that you get some sort of "unable to connect" error.
-
Visit http://localhost:81 and verify that you see Nextcloud.
This test should be run in a private browser window, or HTTPS settings will be cached.
-
First, enable HTTPS (doesn't matter how, but self-signed is easiest).
-
Verify that visiting http://localhost:81 redirects to https://localhost
-
Change the HTTPS port to port 444:
$ sudo snap set nextcloud ports.https=444
-
Close/reopen the private browser window, and verify that visiting http://localhost:81 redirects to https://localhost:444, and you see Nextcloud.
By default the snap uses the default 128MB for PHP's memory limit. That may not be enough if you find the gallery is exhausting it trying to create previews for your larger images.
Start these tests with the memory limit set to the default.
- Run
sudo snap get nextcloud php
- You should see a JSON dump showing a single setting,
memory-limit
, set to128M
.
-
Change the memory limit to 256MB:
$ sudo snap set nextcloud php.memory-limit=256M
-
Visit http://localhost again, and verify that everything still works correctly. Ideally you have an image or set of images whose previews could not be generated without this change. Verify that their previews are generated.
-
Uninstall the candidate Nextcloud and install the current release:
$ sudo snap remove nextcloud $ sudo snap install nextcloud
-
Walk through the basics again, to try and get the previous release looking somewhat used.
-
Update the snap to the candidate:
$ sudo snap refresh --candidate nextcloud
-
Verify that you can still visit http://localhost and everything is still the way you made it in the previous version. Note that if you enabled any third-party apps, you may need to re-enabled them, but their data is still there (an upstream Nextcloud issue, to be resolved in v12).
-
Repeat steps 1-4, but enable HTTPS between steps 2 and 3. Verify that HTTPS is still working correctly after the refresh.
Nextcloud snap Wiki, use all information and scripts at own risk