Skip to content
  • Christian Kellner's avatar
    test: (un-)loading support for mock force power · 27a84722
    Christian Kellner authored
    In MockSysfs, support simulating the unloading and loading of the
    module. On a real system we will get uevents, "change" and "bind"
    when loading and "change" and "unbind" when unloading. In terms of
    udev properties the main difference is the missing DRIVER prop
    after unloading. Also, and most importantly, the force_power
    attribute is only present if the module is loaded.
    
    The real uevents when UNLOADING the intel-wmi-thunderbolt module
    are:
    
    KERNEL[71760.324388] change   /devices/platform/PNP0C14:00/wmi_bus/wmi_bus-PNP0C14:00/86CCFD48-205E-4A77-9C48-2021CBEDE341 (wmi)
    KERNEL[71760.324429] unbind   /devices/platform/PNP0C14:00/wmi_bus/wmi_bus-PNP0C14:00/86CCFD48-205E-4A77-9C48-2021CBEDE341 (wmi)
    KERNEL[71760.324444] remove   /bus/wmi/drivers/intel-wmi-thunderbolt (drivers)
    KERNEL[71760.324507] remove   /module/intel_wmi_thunderbolt (module)
    UDEV  [71760.329248] change   /devices/platform/PNP0C14:00/wmi_bus/wmi_bus-PNP0C14:00/86CCFD48-205E-4A77-9C48-2021CBEDE341 (wmi)
    UDEV  [71760.329301] remove   /bus/wmi/drivers/intel-wmi-thunderbolt (drivers)
    UDEV  [71760.329755] remove   /module/intel_wmi_thunderbolt (module)
    UDEV  [71760.330129] unbind   /devices/platform/PNP0C14:00/wmi_bus/wmi_bus-PNP0C14:00/86CCFD48-205E-4A77-9C48-2021CBEDE341 (wmi)
    
    The `udevadm info` output, with the module unloaded:
    
    P: /devices/platform/PNP0C14:00/wmi_bus/wmi_bus-PNP0C14:00/86CCFD48-205E-4A77-9C48-2021CBEDE341
    E: DEVPATH=/devices/platform/PNP0C14:00/wmi_bus/wmi_bus-PNP0C14:00/86CCFD48-205E-4A77-9C48-2021CBEDE341
    E: DEVTYPE=method
    E: MODALIAS=wmi:86CCFD48-205E-4A77-9C48-2021CBEDE341
    E: SUBSYSTEM=wmi
    E: WMI_GUID=86CCFD48-205E-4A77-9C48-2021CBEDE341
    
    When LOADING the module, we get the following uevents:
    
    KERNEL[71899.232078] add      /module/intel_wmi_thunderbolt (module)
    KERNEL[71899.232152] change   /devices/platform/PNP0C14:00/wmi_bus/wmi_bus-PNP0C14:00/86CCFD48-205E-4A77-9C48-2021CBEDE341 (wmi)
    KERNEL[71899.232176] bind     /devices/platform/PNP0C14:00/wmi_bus/wmi_bus-PNP0C14:00/86CCFD48-205E-4A77-9C48-2021CBEDE341 (wmi)
    KERNEL[71899.232192] add      /bus/wmi/drivers/intel-wmi-thunderbolt (drivers)
    UDEV  [71899.234685] add      /module/intel_wmi_thunderbolt (module)
    UDEV  [71899.236107] change   /devices/platform/PNP0C14:00/wmi_bus/wmi_bus-PNP0C14:00/86CCFD48-205E-4A77-9C48-2021CBEDE341 (wmi)
    UDEV  [71899.237102] add      /bus/wmi/drivers/intel-wmi-thunderbolt (drivers)
    UDEV  [71899.237498] bind     /devices/platform/PNP0C14:00/wmi_bus/wmi_bus-PNP0C14:00/86CCFD48-205E-4A77-9C48-2021CBEDE341 (wmi)
    
    The corresponding `udevadm info` output:
    
    P: /devices/platform/PNP0C14:00/wmi_bus/wmi_bus-PNP0C14:00/86CCFD48-205E-4A77-9C48-2021CBEDE341
    E: DEVPATH=/devices/platform/PNP0C14:00/wmi_bus/wmi_bus-PNP0C14:00/86CCFD48-205E-4A77-9C48-2021CBEDE341
    E: DEVTYPE=method
    E: DRIVER=intel-wmi-thunderbolt
    E: MODALIAS=wmi:86CCFD48-205E-4A77-9C48-2021CBEDE341
    E: SUBSYSTEM=wmi
    E: WMI_GUID=86CCFD48-205E-4A77-9C48-2021CBEDE341
    27a84722