-
Notifications
You must be signed in to change notification settings - Fork 40
Expand file tree
/
Copy pathcli.feature
More file actions
116 lines (104 loc) · 4.87 KB
/
cli.feature
File metadata and controls
116 lines (104 loc) · 4.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: AGPL-3.0-or-later
Feature: CLI updater
Scenario: No update is available - 26.0.0
Given the current version is 26.0.0
When the CLI updater is run
Then the output should contain "Could not find config.php"
Scenario: No update is available - 26.0.0
Given the current installed version is 26.0.0
And there is no update available
When the CLI updater is run successfully
Then the installed version should be 26.0.0
And maintenance mode should be off
And upgrade is not required
Scenario: Update is available - 26.0.0 to 26.0.13
Given the current installed version is 26.0.0
And there is an update to version 26.0.13 available
When the CLI updater is run successfully
Then the installed version should be 26.0.1
And maintenance mode should be off
And upgrade is not required
Scenario: Invalid update is available - 26.0.0 to 26.0.503
Given the current installed version is 26.0.0
And there is an update to version 26.0.503 available
When the CLI updater is run
Then the return code should not be 0
And the output should contain "All downloads failed."
And the installed version should be 26.0.0
And maintenance mode should be off
And upgrade is not required
Scenario: Update without valid signature is being offered - 26.0.0 to 26.0.3
Given the current installed version is 26.0.0
# This works because 26.0.3 is in the signature list with an invalid signature
And there is an update to version 26.0.3 available
When the CLI updater is run
Then the return code should not be 0
And the output should contain "Signature of update is not valid"
And the installed version should be 26.0.0
And maintenance mode should be off
And upgrade is not required
Scenario: Update to older version - 26.0.0 to 25.0.1
Given the current installed version is 26.0.0
And there is an update to version 25.0.1 available
When the CLI updater is run
Then the return code should not be 0
And the output should contain "Downloaded version is lower than installed version"
And the installed version should be 26.0.0
And maintenance mode should be off
And upgrade is not required
Scenario: Update is available but autoupdate is disabled - 26.0.0 to 26.0.1
Given the current installed version is 26.0.0
And the autoupdater is disabled
And there is an update to version 26.0.1 available
When the CLI updater is run
Then the installed version should be 26.0.0
And maintenance mode should be off
And upgrade is not required
Scenario: Update is available and apps2 folder is there and configured - 26.0.0 to 26.0.13
Given the current installed version is 26.0.0
And there is an update to version 26.0.13 available
And there is a folder called "apps2"
And there is a config for a secondary apps directory called "apps2"
When the CLI updater is run successfully
Then the installed version should be 26.0.1
And maintenance mode should be off
And upgrade is not required
Scenario: Update is available and apps2 folder is there and not configured - 26.0.0 to 26.0.13
Given the current installed version is 26.0.0
And there is an update to version 26.0.13 available
And there is a folder called "apps2"
When the CLI updater is run
Then the return code should not be 0
And the output should contain "The following extra files have been found"
And the output should contain "apps2"
And the installed version should be 26.0.0
And maintenance mode should be off
And upgrade is not required
Scenario: Update server returns HTTP 500 - 26.0.0
Given the current installed version is 26.0.0
And the update server returns HTTP status 500
When the CLI updater is run
Then the return code should not be 0
And the output should contain "Update server returned unexpected HTTP status 500"
And the installed version should be 26.0.0
And maintenance mode should be off
And upgrade is not required
Scenario: Update server returns invalid XML - 26.0.0
Given the current installed version is 26.0.0
And the update server returns invalid XML
When the CLI updater is run
Then the return code should not be 0
And the output should contain "Could not parse updater server XML response"
And the installed version should be 26.0.0
And maintenance mode should be off
And upgrade is not required
Scenario: Update server is unreachable - 26.0.0
Given the current installed version is 26.0.0
And the update server is unreachable
When the CLI updater is run
Then the return code should not be 0
And the output should contain "Could not do request to updater server"
And the installed version should be 26.0.0
And maintenance mode should be off
And upgrade is not required