summaryrefslogtreecommitdiffstats
path: root/bitbake/lib
diff options
context:
space:
mode:
authorAlassane Yattara <alassane.yattara@savoirfairelinux.com>2023-12-12 15:17:08 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-12-15 14:37:28 +0000
commita02138ad48a9a5b1aea18d0e8fcf067de46c608a (patch)
treed4095cd68ef8e6df6f53ee2e67b4737d30c7804d /bitbake/lib
parentad2ffefb147fce64a3061c91d98fadffde2f79e6 (diff)
downloadpoky-a02138ad48a9a5b1aea18d0e8fcf067de46c608a.tar.gz
bitbake: toaster/tests: Fixes functional tests warning on autobuilder
tests/functional/test_project_config.py::TestProjectConfig::test_set_download_dir /home/pokybuild/yocto-worker/toaster/build/buildtools/sysroots/x86_64-pokysdk-linux/usr/lib/python3.11/unittest/case.py:678: DeprecationWarning: It is deprecated to return a value that is not None from a test case (<bound method TestProjectConfig.test_set_download_dir of <toaster.tests.functional.test_project_config.TestProjectConfig testMethod=test_set_download_dir>>) return self.run(*args, **kwds) tests/functional/test_project_config.py::TestProjectConfig::test_set_sstate_dir /home/pokybuild/yocto-worker/toaster/build/buildtools/sysroots/x86_64-pokysdk-linux/usr/lib/python3.11/unittest/case.py:678: DeprecationWarning: It is deprecated to return a value that is not None from a test case (<bound method TestProjectConfig.test_set_sstate_dir of <toaster.tests.functional.test_project_config.TestProjectConfig testMethod=test_set_sstate_dir>>) return self.run(*args, **kwds) (Bitbake rev: 938cba3e80f26589ccbe34483c79e17056346fde) Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
-rw-r--r--bitbake/lib/toaster/tests/functional/test_project_config.py164
1 files changed, 85 insertions, 79 deletions
diff --git a/bitbake/lib/toaster/tests/functional/test_project_config.py b/bitbake/lib/toaster/tests/functional/test_project_config.py
index 2d162d81e7..dbee36aa4e 100644
--- a/bitbake/lib/toaster/tests/functional/test_project_config.py
+++ b/bitbake/lib/toaster/tests/functional/test_project_config.py
@@ -163,51 +163,53 @@ class TestProjectConfig(SeleniumFunctionalTestCase):
163 change_dl_dir_btn = self.wait_until_visible('#change-dl_dir-icon', poll=2) 163 change_dl_dir_btn = self.wait_until_visible('#change-dl_dir-icon', poll=2)
164 except TimeoutException: 164 except TimeoutException:
165 # If download dir is not displayed, test is skipped 165 # If download dir is not displayed, test is skipped
166 return True 166 change_dl_dir_btn = None
167 change_dl_dir_btn = self.wait_until_visible('#change-dl_dir-icon', poll=2)
168 change_dl_dir_btn.click()
169 167
170 # downloads dir path doesn't start with / or ${...} 168 if change_dl_dir_btn:
171 input_field = self.wait_until_visible('#new-dl_dir', poll=2) 169 change_dl_dir_btn = self.wait_until_visible('#change-dl_dir-icon', poll=2)
172 input_field.clear() 170 change_dl_dir_btn.click()
173 self.enter_text('#new-dl_dir', 'home/foo') 171
174 element = self.wait_until_visible('#hintError-initialChar-dl_dir', poll=2) 172 # downloads dir path doesn't start with / or ${...}
173 input_field = self.wait_until_visible('#new-dl_dir', poll=2)
174 input_field.clear()
175 self.enter_text('#new-dl_dir', 'home/foo')
176 element = self.wait_until_visible('#hintError-initialChar-dl_dir', poll=2)
175 177
176 msg = 'downloads directory path starts with invalid character but ' \ 178 msg = 'downloads directory path starts with invalid character but ' \
177 'treated as valid' 179 'treated as valid'
178 self.assertTrue((self.INVALID_PATH_START_TEXT in element.text), msg) 180 self.assertTrue((self.INVALID_PATH_START_TEXT in element.text), msg)
179 181
180 # downloads dir path has a space 182 # downloads dir path has a space
181 self.driver.find_element(By.ID, 'new-dl_dir').clear() 183 self.driver.find_element(By.ID, 'new-dl_dir').clear()
182 self.enter_text('#new-dl_dir', '/foo/bar a') 184 self.enter_text('#new-dl_dir', '/foo/bar a')
183 185
184 element = self.wait_until_visible('#hintError-dl_dir', poll=2) 186 element = self.wait_until_visible('#hintError-dl_dir', poll=2)
185 msg = 'downloads directory path characters invalid but treated as valid' 187 msg = 'downloads directory path characters invalid but treated as valid'
186 self.assertTrue((self.INVALID_PATH_CHAR_TEXT in element.text), msg) 188 self.assertTrue((self.INVALID_PATH_CHAR_TEXT in element.text), msg)
187 189
188 # downloads dir path starts with ${...} but has a space 190 # downloads dir path starts with ${...} but has a space
189 self.driver.find_element(By.ID,'new-dl_dir').clear() 191 self.driver.find_element(By.ID,'new-dl_dir').clear()
190 self.enter_text('#new-dl_dir', '${TOPDIR}/down foo') 192 self.enter_text('#new-dl_dir', '${TOPDIR}/down foo')
191 193
192 element = self.wait_until_visible('#hintError-dl_dir', poll=2) 194 element = self.wait_until_visible('#hintError-dl_dir', poll=2)
193 msg = 'downloads directory path characters invalid but treated as valid' 195 msg = 'downloads directory path characters invalid but treated as valid'
194 self.assertTrue((self.INVALID_PATH_CHAR_TEXT in element.text), msg) 196 self.assertTrue((self.INVALID_PATH_CHAR_TEXT in element.text), msg)
195 197
196 # downloads dir path starts with / 198 # downloads dir path starts with /
197 self.driver.find_element(By.ID,'new-dl_dir').clear() 199 self.driver.find_element(By.ID,'new-dl_dir').clear()
198 self.enter_text('#new-dl_dir', '/bar/foo') 200 self.enter_text('#new-dl_dir', '/bar/foo')
199 201
200 hidden_element = self.driver.find_element(By.ID,'hintError-dl_dir') 202 hidden_element = self.driver.find_element(By.ID,'hintError-dl_dir')
201 self.assertEqual(hidden_element.is_displayed(), False, 203 self.assertEqual(hidden_element.is_displayed(), False,
202 'downloads directory path valid but treated as invalid') 204 'downloads directory path valid but treated as invalid')
203 205
204 # downloads dir path starts with ${...} 206 # downloads dir path starts with ${...}
205 self.driver.find_element(By.ID,'new-dl_dir').clear() 207 self.driver.find_element(By.ID,'new-dl_dir').clear()
206 self.enter_text('#new-dl_dir', '${TOPDIR}/down') 208 self.enter_text('#new-dl_dir', '${TOPDIR}/down')
207 209
208 hidden_element = self.driver.find_element(By.ID,'hintError-dl_dir') 210 hidden_element = self.driver.find_element(By.ID,'hintError-dl_dir')
209 self.assertEqual(hidden_element.is_displayed(), False, 211 self.assertEqual(hidden_element.is_displayed(), False,
210 'downloads directory path valid but treated as invalid') 212 'downloads directory path valid but treated as invalid')
211 213
212 def test_set_sstate_dir(self): 214 def test_set_sstate_dir(self):
213 """ 215 """
@@ -217,53 +219,57 @@ class TestProjectConfig(SeleniumFunctionalTestCase):
217 self._navigate_bbv_page() 219 self._navigate_bbv_page()
218 220
219 try: 221 try:
220 self.wait_until_visible('#change-sstate_dir-icon', poll=2) 222 btn_chg_sstate_dir = self.wait_until_visible(
223 '#change-sstate_dir-icon',
224 poll=2
225 )
221 self.click('#change-sstate_dir-icon') 226 self.click('#change-sstate_dir-icon')
222 except TimeoutException: 227 except TimeoutException:
223 # If sstate_dir is not displayed, test is skipped 228 # If sstate_dir is not displayed, test is skipped
224 return True 229 btn_chg_sstate_dir = None
225 230
226 # path doesn't start with / or ${...} 231 if btn_chg_sstate_dir: # Skip continuation if sstate_dir is not displayed
227 input_field = self.wait_until_visible('#new-sstate_dir', poll=2) 232 # path doesn't start with / or ${...}
228 input_field.clear() 233 input_field = self.wait_until_visible('#new-sstate_dir', poll=2)
229 self.enter_text('#new-sstate_dir', 'home/foo') 234 input_field.clear()
230 element = self.wait_until_visible('#hintError-initialChar-sstate_dir', poll=2) 235 self.enter_text('#new-sstate_dir', 'home/foo')
231 236 element = self.wait_until_visible('#hintError-initialChar-sstate_dir', poll=2)
232 msg = 'sstate directory path starts with invalid character but ' \ 237
233 'treated as valid' 238 msg = 'sstate directory path starts with invalid character but ' \
234 self.assertTrue((self.INVALID_PATH_START_TEXT in element.text), msg) 239 'treated as valid'
235 240 self.assertTrue((self.INVALID_PATH_START_TEXT in element.text), msg)
236 # path has a space 241
237 self.driver.find_element(By.ID, 'new-sstate_dir').clear() 242 # path has a space
238 self.enter_text('#new-sstate_dir', '/foo/bar a') 243 self.driver.find_element(By.ID, 'new-sstate_dir').clear()
239 244 self.enter_text('#new-sstate_dir', '/foo/bar a')
240 element = self.wait_until_visible('#hintError-sstate_dir', poll=2) 245
241 msg = 'sstate directory path characters invalid but treated as valid' 246 element = self.wait_until_visible('#hintError-sstate_dir', poll=2)
242 self.assertTrue((self.INVALID_PATH_CHAR_TEXT in element.text), msg) 247 msg = 'sstate directory path characters invalid but treated as valid'
243 248 self.assertTrue((self.INVALID_PATH_CHAR_TEXT in element.text), msg)
244 # path starts with ${...} but has a space 249
245 self.driver.find_element(By.ID,'new-sstate_dir').clear() 250 # path starts with ${...} but has a space
246 self.enter_text('#new-sstate_dir', '${TOPDIR}/down foo') 251 self.driver.find_element(By.ID,'new-sstate_dir').clear()
247 252 self.enter_text('#new-sstate_dir', '${TOPDIR}/down foo')
248 element = self.wait_until_visible('#hintError-sstate_dir', poll=2) 253
249 msg = 'sstate directory path characters invalid but treated as valid' 254 element = self.wait_until_visible('#hintError-sstate_dir', poll=2)
250 self.assertTrue((self.INVALID_PATH_CHAR_TEXT in element.text), msg) 255 msg = 'sstate directory path characters invalid but treated as valid'
251 256 self.assertTrue((self.INVALID_PATH_CHAR_TEXT in element.text), msg)
252 # path starts with / 257
253 self.driver.find_element(By.ID,'new-sstate_dir').clear() 258 # path starts with /
254 self.enter_text('#new-sstate_dir', '/bar/foo') 259 self.driver.find_element(By.ID,'new-sstate_dir').clear()
255 260 self.enter_text('#new-sstate_dir', '/bar/foo')
256 hidden_element = self.driver.find_element(By.ID, 'hintError-sstate_dir') 261
257 self.assertEqual(hidden_element.is_displayed(), False, 262 hidden_element = self.driver.find_element(By.ID, 'hintError-sstate_dir')
258 'sstate directory path valid but treated as invalid') 263 self.assertEqual(hidden_element.is_displayed(), False,
259 264 'sstate directory path valid but treated as invalid')
260 # paths starts with ${...} 265
261 self.driver.find_element(By.ID, 'new-sstate_dir').clear() 266 # paths starts with ${...}
262 self.enter_text('#new-sstate_dir', '${TOPDIR}/down') 267 self.driver.find_element(By.ID, 'new-sstate_dir').clear()
263 268 self.enter_text('#new-sstate_dir', '${TOPDIR}/down')
264 hidden_element = self.driver.find_element(By.ID, 'hintError-sstate_dir') 269
265 self.assertEqual(hidden_element.is_displayed(), False, 270 hidden_element = self.driver.find_element(By.ID, 'hintError-sstate_dir')
266 'sstate directory path valid but treated as invalid') 271 self.assertEqual(hidden_element.is_displayed(), False,
272 'sstate directory path valid but treated as invalid')
267 273
268 def _change_bbv_value(self, **kwargs): 274 def _change_bbv_value(self, **kwargs):
269 var_name, field, btn_id, input_id, value, save_btn, *_ = kwargs.values() 275 var_name, field, btn_id, input_id, value, save_btn, *_ = kwargs.values()