All unit_tests now pass for ATOMS:
[scilab.git] / scilab / modules / atoms / tests / unit_tests / atomsUpdate.tst
1 // =============================================================================
2 // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3 // Copyright (C) 2009 - DIGITEO - Pierre MARECHAL <pierre.marechal@scilab.org>
4 //
5 //  This file is distributed under the same license as the Scilab package.
6 // =============================================================================
7
8 // <-- CLI SHELL MODE -->
9
10
11
12 load("SCI/modules/atoms/macros/atoms_internals/lib");
13
14 // We need a clean version
15 // =============================================================================
16 if ~isempty( atomsGetInstalled() ) then pause, end
17
18 // If previous test did not end properly, restore, else backup config file
19 atomsRestoreConfig(%T);
20 atomsSaveConfig();
21
22 // Do not use the autoload system
23 // =============================================================================
24 atomsSetConfig("autoloadAddAfterInstall","False");
25 atomsSetConfig("Verbose" ,"False");
26
27
28 // 1st test-case : Just install the toolbox 5
29 // =============================================================================
30
31 // Load the 1st scenario : See scene10.test.atoms.scilab.org.txt
32 atomsRepositorySetOfl("http://scene10.6.0.test.atoms.scilab.org");
33
34 atomsInstall("toolbox_5V6","user");
35
36 // Check if the module is really installed
37
38 if ~atomsIsInstalled(["toolbox_5V6" "1.0-1"],"user") then pause, end
39 if ~atomsIsInstalled(["toolbox_4V6" "1.0-1"],"user") then pause, end
40 if  atomsIsInstalled(["toolbox_4V6" "1.1-1"],"all")  then pause, end
41 if ~atomsIsInstalled(["toolbox_2V6" "1.0-1"],"user") then pause, end
42 if ~atomsIsInstalled(["toolbox_1V6" "1.0-1"],"user") then pause, end
43
44 if atomsGetInstalledStatus(["toolbox_5V6" "1.0-1"],"user")<>"I" then pause, end
45 if atomsGetInstalledStatus(["toolbox_4V6" "1.0-1"],"user")<>"A" then pause, end
46 if atomsGetInstalledStatus(["toolbox_2V6" "1.0-1"],"user")<>"A" then pause, end
47 if atomsGetInstalledStatus(["toolbox_1V6" "1.0-1"],"user")<>"A" then pause, end
48
49 // Load the 2nd scenario : See scene11.test.atoms.scilab.org.txt
50 atomsRepositorySetOfl("http://scene11.6.0.test.atoms.scilab.org");
51
52 atomsUpdate();
53
54 if ~atomsIsInstalled(["toolbox_5V6" "1.0-1"],"user") then pause, end
55 if  atomsIsInstalled(["toolbox_4V6" "1.0-1"],"all")  then pause, end
56 if ~atomsIsInstalled(["toolbox_4V6" "1.1-1"],"user") then pause, end
57 if ~atomsIsInstalled(["toolbox_2V6" "1.0-1"],"user") then pause, end
58 if ~atomsIsInstalled(["toolbox_1V6" "1.0-1"],"user") then pause, end
59
60 if atomsGetInstalledStatus(["toolbox_5V6" "1.0-1"],"user")<>"I" then pause, end
61 if atomsGetInstalledStatus(["toolbox_4V6" "1.1-1"],"user")<>"A" then pause, end
62 if atomsGetInstalledStatus(["toolbox_2V6" "1.0-1"],"user")<>"A" then pause, end
63 if atomsGetInstalledStatus(["toolbox_1V6" "1.0-1"],"user")<>"A" then pause, end
64
65 // Remove the module
66 atomsRemove("toolbox_5V6","user");
67
68 // no module should be installed
69 if ~isempty( atomsGetInstalled() ) then pause, end
70
71 // 2nd test-case : Install toolbox 4 and then toolbox 5
72 // =============================================================================
73
74 // Load the 1st scenario : See scene10.test.atoms.scilab.org.txt
75 atomsRepositorySetOfl("http://scene10.6.0.test.atoms.scilab.org");
76
77 atomsInstall("toolbox_4V6","user");
78 atomsInstall("toolbox_5V6","user");
79
80 // Check if the module is really installed
81
82 if ~atomsIsInstalled(["toolbox_5V6" "1.0-1"],"user") then pause, end
83 if ~atomsIsInstalled(["toolbox_4V6" "1.0-1"],"user") then pause, end
84 if  atomsIsInstalled(["toolbox_4V6" "1.1-1"],"all")  then pause, end
85 if ~atomsIsInstalled(["toolbox_2V6" "1.0-1"],"user") then pause, end
86 if ~atomsIsInstalled(["toolbox_1V6" "1.0-1"],"user") then pause, end
87
88 if atomsGetInstalledStatus(["toolbox_5V6" "1.0-1"],"user")<>"I" then pause, end
89 if atomsGetInstalledStatus(["toolbox_4V6" "1.0-1"],"user")<>"I" then pause, end
90 if atomsGetInstalledStatus(["toolbox_2V6" "1.0-1"],"user")<>"A" then pause, end
91 if atomsGetInstalledStatus(["toolbox_1V6" "1.0-1"],"user")<>"A" then pause, end
92
93 // Load the 2nd scenario : See scene11.test.atoms.scilab.org.txt
94 atomsRepositorySetOfl("http://scene11.6.0.test.atoms.scilab.org");
95
96 atomsUpdate();
97
98 if ~atomsIsInstalled(["toolbox_5V6" "1.0-1"],"user") then pause, end
99 if  atomsIsInstalled(["toolbox_4V6" "1.0-1"],"all")  then pause, end
100 if ~atomsIsInstalled(["toolbox_4V6" "1.1-1"],"user") then pause, end
101 if ~atomsIsInstalled(["toolbox_2V6" "1.0-1"],"user") then pause, end
102 if ~atomsIsInstalled(["toolbox_1V6" "1.0-1"],"user") then pause, end
103
104 if atomsGetInstalledStatus(["toolbox_5V6" "1.0-1"],"user")<>"I" then pause, end
105 if atomsGetInstalledStatus(["toolbox_4V6" "1.1-1"],"user")<>"I" then pause, end
106 if atomsGetInstalledStatus(["toolbox_2V6" "1.0-1"],"user")<>"A" then pause, end
107 if atomsGetInstalledStatus(["toolbox_1V6" "1.0-1"],"user")<>"A" then pause, end
108
109 // Remove the module
110 atomsRemove("toolbox_5V6","user");
111 atomsRemove("toolbox_4V6","user");
112
113 // no module should be installed
114 if ~isempty( atomsGetInstalled() ) then pause, end
115
116 // 3rd test-case : Install toolbox 4 and toolbox 3
117 // => Test the behaviour of toolbox_2
118 // =============================================================================
119
120 // Load the 1st scenario : See scene10.test.atoms.scilab.org.txt
121 atomsRepositorySetOfl("http://scene10.6.0.test.atoms.scilab.org");
122
123 atomsInstall("toolbox_3V6","user");
124 atomsInstall("toolbox_4V6","user");
125
126 if ~atomsIsInstalled(["toolbox_4V6" "1.0-1"],"user") then pause, end
127 if ~atomsIsInstalled(["toolbox_3V6" "1.0-1"],"user") then pause, end
128 if ~atomsIsInstalled(["toolbox_2V6" "2.0-1"],"user") then pause, end
129 if ~atomsIsInstalled(["toolbox_2V6" "1.0-1"],"user") then pause, end
130 if ~atomsIsInstalled(["toolbox_1V6" "1.0-1"],"user") then pause, end
131
132 if  atomsIsInstalled(["toolbox_4V6" "1.1-1"],"all")  then pause, end
133 if  atomsIsInstalled(["toolbox_2V6" "2.1-1"],"all")  then pause, end
134
135 if atomsGetInstalledStatus(["toolbox_4V6" "1.0-1"],"user")<>"I" then pause, end
136 if atomsGetInstalledStatus(["toolbox_3V6" "1.0-1"],"user")<>"I" then pause, end
137 if atomsGetInstalledStatus(["toolbox_2V6" "2.0-1"],"user")<>"A" then pause, end
138 if atomsGetInstalledStatus(["toolbox_2V6" "1.0-1"],"user")<>"A" then pause, end
139 if atomsGetInstalledStatus(["toolbox_1V6" "1.0-1"],"user")<>"A" then pause, end
140
141 // Load the 2nd scenario : See scene11.test.atoms.scilab.org.txt
142 atomsRepositorySetOfl("http://scene11.6.0.test.atoms.scilab.org");
143
144 atomsUpdate();
145
146 if ~atomsIsInstalled(["toolbox_4V6" "1.1-1"],"user") then pause, end
147 if ~atomsIsInstalled(["toolbox_3V6" "1.0-1"],"user") then pause, end
148 if ~atomsIsInstalled(["toolbox_2V6" "2.1-1"],"user") then pause, end
149 if ~atomsIsInstalled(["toolbox_2V6" "1.0-1"],"user") then pause, end
150 if ~atomsIsInstalled(["toolbox_1V6" "1.0-1"],"user") then pause, end
151
152 if  atomsIsInstalled(["toolbox_4V6" "1.0-1"],"all")  then pause, end
153 if  atomsIsInstalled(["toolbox_2V6" "2.0-1"],"all")  then pause, end
154
155 if atomsGetInstalledStatus(["toolbox_4V6" "1.1-1"],"user")<>"I" then pause, end
156 if atomsGetInstalledStatus(["toolbox_3V6" "1.0-1"],"user")<>"I" then pause, end
157 if atomsGetInstalledStatus(["toolbox_2V6" "2.1-1"],"user")<>"A" then pause, end
158 if atomsGetInstalledStatus(["toolbox_2V6" "1.0-1"],"user")<>"A" then pause, end
159 if atomsGetInstalledStatus(["toolbox_1V6" "1.0-1"],"user")<>"A" then pause, end
160
161 atomsRemove("toolbox_4V6","user");
162 atomsRemove("toolbox_3V6","user");
163
164 // no module should be installed
165 if ~isempty( atomsGetInstalled() ) then pause, end
166
167 // 4th test-case : Test the user/allusers behaviour
168 // =============================================================================
169
170 // Load the 1st scenario : See scene10.test.atoms.scilab.org.txt
171 atomsRepositorySetOfl("http://scene10.6.0.test.atoms.scilab.org");
172
173 atomsInstall("toolbox_5V6","user");
174 atomsInstall("toolbox_5V6","allusers");
175
176 if ~atomsIsInstalled(["toolbox_5V6" "1.0-1"],"user") then pause, end
177 if ~atomsIsInstalled(["toolbox_4V6" "1.0-1"],"user") then pause, end
178 if  atomsIsInstalled(["toolbox_4V6" "1.1-1"],"user") then pause, end
179 if ~atomsIsInstalled(["toolbox_2V6" "1.0-1"],"user") then pause, end
180 if ~atomsIsInstalled(["toolbox_1V6" "1.0-1"],"user") then pause, end
181
182 if ~atomsIsInstalled(["toolbox_5V6" "1.0-1"],"allusers") then pause, end
183 if ~atomsIsInstalled(["toolbox_4V6" "1.0-1"],"allusers") then pause, end
184 if  atomsIsInstalled(["toolbox_4V6" "1.1-1"],"allusers") then pause, end
185 if ~atomsIsInstalled(["toolbox_2V6" "1.0-1"],"allusers") then pause, end
186 if ~atomsIsInstalled(["toolbox_1V6" "1.0-1"],"allusers") then pause, end
187
188 if atomsGetInstalledStatus(["toolbox_5V6" "1.0-1"],"user")<>"I" then pause, end
189 if atomsGetInstalledStatus(["toolbox_4V6" "1.0-1"],"user")<>"A" then pause, end
190 if atomsGetInstalledStatus(["toolbox_2V6" "1.0-1"],"user")<>"A" then pause, end
191 if atomsGetInstalledStatus(["toolbox_1V6" "1.0-1"],"user")<>"A" then pause, end
192
193 if atomsGetInstalledStatus(["toolbox_5V6" "1.0-1"],"allusers")<>"I" then pause, end
194 if atomsGetInstalledStatus(["toolbox_4V6" "1.0-1"],"allusers")<>"A" then pause, end
195 if atomsGetInstalledStatus(["toolbox_2V6" "1.0-1"],"allusers")<>"A" then pause, end
196 if atomsGetInstalledStatus(["toolbox_1V6" "1.0-1"],"allusers")<>"A" then pause, end
197
198 // Load the 2nd scenario : See scene11.test.atoms.scilab.org.txt
199 atomsRepositorySetOfl("http://scene11.6.0.test.atoms.scilab.org");
200
201 atomsUpdate([],"user");
202
203 if ~atomsIsInstalled(["toolbox_5V6" "1.0-1"],"user") then pause, end
204 if  atomsIsInstalled(["toolbox_4V6" "1.0-1"],"user") then pause, end
205 if ~atomsIsInstalled(["toolbox_4V6" "1.1-1"],"user") then pause, end
206 if ~atomsIsInstalled(["toolbox_2V6" "1.0-1"],"user") then pause, end
207 if ~atomsIsInstalled(["toolbox_1V6" "1.0-1"],"user") then pause, end
208
209 if ~atomsIsInstalled(["toolbox_5V6" "1.0-1"],"allusers") then pause, end
210 if ~atomsIsInstalled(["toolbox_4V6" "1.0-1"],"allusers") then pause, end
211 if  atomsIsInstalled(["toolbox_4V6" "1.1-1"],"allusers") then pause, end
212 if ~atomsIsInstalled(["toolbox_2V6" "1.0-1"],"allusers") then pause, end
213 if ~atomsIsInstalled(["toolbox_1V6" "1.0-1"],"allusers") then pause, end
214
215 if atomsGetInstalledStatus(["toolbox_4V6" "1.1-1"],"user")<>"A" then pause, end
216 if atomsGetInstalledStatus(["toolbox_4V6" "1.0-1"],"allusers")<>"A" then pause, end
217
218 atomsUpdate([],"allusers");
219
220 if ~atomsIsInstalled(["toolbox_5V6" "1.0-1"],"user") then pause, end
221 if  atomsIsInstalled(["toolbox_4V6" "1.0-1"],"user") then pause, end
222 if ~atomsIsInstalled(["toolbox_4V6" "1.1-1"],"user") then pause, end
223 if ~atomsIsInstalled(["toolbox_2V6" "1.0-1"],"user") then pause, end
224 if ~atomsIsInstalled(["toolbox_1V6" "1.0-1"],"user") then pause, end
225
226 if ~atomsIsInstalled(["toolbox_5V6" "1.0-1"],"allusers") then pause, end
227 if  atomsIsInstalled(["toolbox_4V6" "1.0-1"],"allusers") then pause, end
228 if ~atomsIsInstalled(["toolbox_4V6" "1.1-1"],"allusers") then pause, end
229 if ~atomsIsInstalled(["toolbox_2V6" "1.0-1"],"allusers") then pause, end
230 if ~atomsIsInstalled(["toolbox_1V6" "1.0-1"],"allusers") then pause, end
231
232 if atomsGetInstalledStatus(["toolbox_4V6" "1.1-1"],"user")<>"A" then pause, end
233 if atomsGetInstalledStatus(["toolbox_4V6" "1.1-1"],"allusers")<>"A" then pause, end
234
235 atomsRemove("toolbox_5V6","user");
236 atomsRemove("toolbox_5V6","allusers");
237
238 // no module should be installed
239 if ~isempty( atomsGetInstalled() ) then pause, end
240
241 // 5th test-case : Test the packaging version update
242 // =============================================================================
243
244 // Load the 1st scenario : See scene11.test.atoms.scilab.org.txt
245 atomsRepositorySetOfl("http://scene11.6.0.test.atoms.scilab.org");
246
247 atomsInstall("toolbox_5V6","user");
248
249 // Check if the module is really installed
250
251 if ~atomsIsInstalled(["toolbox_5V6" "1.0-1"],"user") then pause, end
252 if ~atomsIsInstalled(["toolbox_4V6" "1.1-1"],"all")  then pause, end
253 if ~atomsIsInstalled(["toolbox_2V6" "1.0-1"],"user") then pause, end
254 if ~atomsIsInstalled(["toolbox_1V6" "1.0-1"],"user") then pause, end
255
256 if atomsGetInstalledStatus(["toolbox_5V6" "1.0-1"],"user")<>"I" then pause, end
257 if atomsGetInstalledStatus(["toolbox_4V6" "1.1-1"],"user")<>"A" then pause, end
258 if atomsGetInstalledStatus(["toolbox_2V6" "1.0-1"],"user")<>"A" then pause, end
259 if atomsGetInstalledStatus(["toolbox_1V6" "1.0-1"],"user")<>"A" then pause, end
260
261 // Load the 2nd scenario : See scene12.test.atoms.scilab.org.txt
262 atomsRepositorySetOfl("http://scene12.6.0.test.atoms.scilab.org");
263
264 atomsUpdate();
265
266 if ~atomsIsInstalled(["toolbox_5V6" "1.0-1"],"user") then pause, end
267 if ~atomsIsInstalled(["toolbox_4V6" "1.1-1"],"user") then pause, end
268 if ~atomsIsInstalled(["toolbox_2V6" "1.0-1"],"user") then pause, end
269 if ~atomsIsInstalled(["toolbox_1V6" "1.0-1"],"user") then pause, end
270
271 if atomsGetInstalledStatus(["toolbox_5V6" "1.0-1"],"user")<>"I" then pause, end
272 if atomsGetInstalledStatus(["toolbox_4V6" "1.1-1"],"user")<>"A" then pause, end
273 if atomsGetInstalledStatus(["toolbox_2V6" "1.0-1"],"user")<>"A" then pause, end
274 if atomsGetInstalledStatus(["toolbox_1V6" "1.0-1"],"user")<>"A" then pause, end
275
276 // Remove the module
277 atomsRemove("toolbox_5V6","user");
278
279 // no module should be installed
280 if ~isempty( atomsGetInstalled() ) then pause, end
281
282 // Restore original values
283 // =============================================================================
284 atomsRestoreConfig(%T);
285
286 atomsRepositorySetOfl(mgetl(SCI+"/modules/atoms/tests/unit_tests/repositories.orig"));