Skip to content
  • Arkadiusz Hiler's avatar
    tests/kms_chamelium: Wait for chamelium being reachable after a suspend · ce130a07
    Arkadiusz Hiler authored
    Getting network back after waking up from suspend takes some time.
    If it's not quick enough, it may cause any following chamelium_rpc
    to fail.
    
    This includes the chamelium port reset in exit handler:
    
    	igt_chamelium-CRITICAL: Test assertion failure function chamelium_rpc,
    				file ../lib/igt_chamelium.c:349:
    	igt_chamelium-CRITICAL: Failed assertion: !chamelium->env.fault_occurred
    	igt_chamelium-CRITICAL: Last errno: 113, No route to host
    	igt_chamelium-CRITICAL: Chamelium RPC call failed: libcurl failed to execute
    				the HTTP POST transaction, explaining:
    				Failed to connect to 192.168.1.224 port 9992: No route to host
    
    	Stack trace:
    	  #0 ../lib/igt_core.c:1674 __igt_fail_assert()
    	  #1 [chamelium_rpc+0x1ea]
    	  #2 ../lib/igt_chamelium.c:2274 chamelium_reset()
    	  #3 ../lib/igt_chamelium.c:2361 chamelium_deinit()
    	  #4 ../lib/igt_core.c:2124 call_exit_handlers()
    
    So let's wait for Chamelium to be reachable after each suspend_autoresume.
    
    v2: Bump the network timeout to 20s,
        the slowest observed bring-up was 17s. (Petri)
        Do not DECREF if we get NULL from __chmelium_rpc(). (Simon & CI)
    
    Cc: Simon Ser <simon.ser@intel.com>
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=109380
    
    
    Signed-off-by: default avatarArkadiusz Hiler <arkadiusz.hiler@intel.com>
    Reviewed-by: default avatarSimon Ser <simon.ser@intel.com>
    ce130a07