• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revisióneda4e62cc2f5d12fcedcf799a5a3f9eba855ad77 (tree)
Tiempo2019-11-02 03:19:24
AutorPhilippe Mathieu-Daudé <philmd@redh...>
CommiterPhilippe Mathieu-Daudé

Log Message

tests/fw_cfg: Test 'reboot-timeout=-1' special value

The special value -1 means "don't reboot" for QEMU/libvirt.
Add a trivial test.

Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>

Cambiar Resumen

Diferencia incremental

--- a/tests/fw_cfg-test.c
+++ b/tests/fw_cfg-test.c
@@ -194,6 +194,26 @@ static void test_fw_cfg_reboot_timeout(void)
194194 qtest_quit(s);
195195 }
196196
197+static void test_fw_cfg_no_reboot_timeout(void)
198+{
199+ QFWCFG *fw_cfg;
200+ QTestState *s;
201+ uint32_t reboot_timeout = 0;
202+ size_t filesize;
203+
204+ /* Special value -1 means "don't reboot" */
205+ s = qtest_init("-boot reboot-timeout=-1");
206+ fw_cfg = pc_fw_cfg_init(s);
207+
208+ filesize = qfw_cfg_get_file(fw_cfg, "etc/boot-fail-wait",
209+ &reboot_timeout, sizeof(reboot_timeout));
210+ g_assert_cmpint(filesize, ==, sizeof(reboot_timeout));
211+ reboot_timeout = le32_to_cpu(reboot_timeout);
212+ g_assert_cmpint(reboot_timeout, ==, UINT32_MAX);
213+ pc_fw_cfg_uninit(fw_cfg);
214+ qtest_quit(s);
215+}
216+
197217 static void test_fw_cfg_splash_time(void)
198218 {
199219 QFWCFG *fw_cfg;
@@ -233,6 +253,7 @@ int main(int argc, char **argv)
233253 qtest_add_func("fw_cfg/numa", test_fw_cfg_numa);
234254 qtest_add_func("fw_cfg/boot_menu", test_fw_cfg_boot_menu);
235255 qtest_add_func("fw_cfg/reboot_timeout", test_fw_cfg_reboot_timeout);
256+ qtest_add_func("fw_cfg/no_reboot_timeout", test_fw_cfg_no_reboot_timeout);
236257 qtest_add_func("fw_cfg/splash_time", test_fw_cfg_splash_time);
237258
238259 return g_test_run();