You can find the related info in: https://github.com/xupengfe/tbt_driver_cases TBT: thunderbolt
When testing it is better to have kmemleak, Intel-IOMMU and DMA-API debugging enabled from time to time: CONFIG_DEBUG_KMEMLEAK=y CONFIG_INTEL_IOMMU=y CONFIG_INTEL_IOMMU_DEFAULT_ON=y CONFIG_DMA_API_DEBUG=y CONFIG_USB4=m CONFIG_USB4_NET=m The following test cases should be done in both ACPI enumeration (BIOS assisged) and native PCIe hotplug mode.
Due to split none/user/secure/dp mode tests and common tests, use below commands to execute tbt cases: -> For common tests, run the common cases which is not related with tbt mode: ./runtests.sh -p cfl-h-rvp -P cfl-h-rvp -g tbt_common_subset -o /opt/logs/tbt -c
-> For none/user/secure/dp mode tests: In none mode, please run: ./runtests.sh -p cfl-h-rvp -P cfl-h-rvp -f ddt_intel/tbt_none_tests -o /opt/logs/tbt -c
In user mode, please run: ./runtests.sh -p cfl-h-rvp -P cfl-h-rvp -f ddt_intel/tbt_user_tests -o /opt/logs/tbt -c
In secure mode, please run: ./runtests.sh -pcfl-h-rvp -P cfl-h-rvp -f ddt_intel/tbt_secure_tests -o /opt/logs/tbt -c
In dp mode, please run: ./runtests.sh -p cfl-h-rvp -P cfl-h-rvp -f ddt_intel/tbt_dp_tests -o /opt/logs/tbt -c
Command sample: "./runtests.sh -p cfl-s_cnl-h -P cfl-s_cnl-h -f ddt_intel/tbt_bat_tests -o /opt/logs/tbt_bat -c"
Steps: check kconfig should set below items:
CONFIG_USB4=m
CONFIG_USB4_NET=m
Other value will be failed.
Steps: Check if in user mode, will approve all tbt devices.
Check if in other mode, will check device and domain sysfs files.
Check all sysfs files should be exist and show content.
Steps: Check tbt device connected, if not connect, will conect by clearware
Load thunderbolt_net driver, check is there abnormal dmesg print
Unload thunderbolt_net driver, check is there abnormal dmesg print
Recover if thunderbolt_net driver is loaded before test.
Steps: Check tbt device connected, if not connect, will conect by clearware
Load thunderbolt driver, check is there abnormal dmesg print
Unload thunderbolt driver, check is there abnormal dmesg print
Recover if thunderbolt driver is loaded before test.
Steps: Load thunderbolt_net driver and check init time, if more than 9s,
case will be failed.
Recover if thunderbolt_net driver is loaded before test
Steps: Load thunderbolt driver and check init time, if more than 9s,
case will be failed.
Recover if thunderbolt driver is loaded before test.
Steps: Check dmesg log is start from 0.0000s or not
If yes, check "PCIeHotplug" status to confirm native PCIe or Legacy mode
Check native PCIe mode, should find "reconfiguring" in dmesg
Check Legacy mode, should not find "reconfiguring" in dmesg
Otherwise will fail the case.
Steps: Check /sys/bus/thunderbolt/devices/x-x/authorized should exist,
not null and show content.
Steps: Check /sys/bus/thunderbolt/devices/x-x/device should exist,
not null and show content.
Steps: Check /sys/bus/thunderbolt/devices/x-x/device_name should exist,
not null and show content.
Steps: Check /sys/bus/thunderbolt/devices/x-x/nvm_authenticate should exist,
and set 0, otherwise will be failed the case.
Steps: Check /sys/bus/thunderbolt/devices/x-x/nvm_version should exist,
not null and show content.
Steps: Check /sys/bus/thunderbolt/devices/x-x/uevent should exist,
not null and show content.
Steps: Check /sys/bus/thunderbolt/devices/x-x/unique_id should exist,
not null and show content.
Steps: Check /sys/bus/thunderbolt/devices/x-x/vendor should exist,
not null and show content.
Steps: Check /sys/bus/thunderbolt/devices/x-x/vendor_name should exist,
not null and show content.
Steps: Check /sys/bus/thunderbolt/devices/domainx/security exist,
not null and show content.
Steps: Check /sys/bus/thunderbolt/devices/domainx/uevent exist,
not null and show content.
Steps: Check tbt device connected, and check topology
show all route string and device_name.
Command sample: "./runtests.sh -p cfl-s_cnl-h -P cfl-s_cnl-h -f ddt_intel/tbt_func_tests -o /opt/logs/tbt_func -c"
Steps: Except dponly mode, check tbt device connected,
find ssd connected with tbt, transfer one 10M file into ssd by dd,
transfer the 10M file in ssd to platform, and compare the 10M file
should be same.
Steps: Except dponly mode, check tbt device connected,
find ssd connected with tbt, transfer one 100M file into ssd by dd,
transfer the 100M file in ssd to platform, and compare the 100M file
should be same.
Steps: Except dponly mode, check tbt device connected,
find ssd connected with tbt, transfer one 500M file into ssd by dd,
transfer the 500M file in ssd to platform, and compare the 500M file
should be same.
Steps: Except dponly mode, check tbt device connected,
find ssd connected with tbt, transfer one 1000M file into ssd by dd,
transfer the 1000M file in ssd to platform, and compare the 1000M file
should be same.
Steps: Except dponly mode, check tbt device connected,
find usb2.0 connected with tbt, transfer one 100M file into usb2.0 by dd,
transfer the 100M file from usb2.0 to platform, and compare the 100M file
should be same.
Steps: Except dponly mode, check tbt device connected,
find usb3.0 connected with tbt, transfer one 100M file into usb3.0 by dd,
transfer the 100M file from usb3.0 to platform, and compare the 100M file
should be same.
Command sample: "./runtests.sh -p cfl-h-rvp -P cfl-h-rvp -f ddt_intel/tbt_hotplug_tests -o /opt/logs/tbt_hotplug -c"
Steps: Except dp mode, plug in tbt devices which connected ssd, appove tbt access,
transfer 600M file into ssd, when transfer file is ongoing, plug out all
tbt devices, 30s later plug in tbt devices should without issue, and transfer
600M file in ssd successfully.
Steps: Except dp mode, plug in tbt devices which connected usb2.0, appove tbt access,
transfer 600M file into usb2.0, when transfer file is ongoing, plug out all
tbt devices, 30s later plug in tbt devices should without issue, and transfer
600M file in 2.0 successfully.
Steps: Except dp mode, plug in tbt devices which connected usb3.0, appove tbt access,
transfer 600M file into usb3.0, when transfer file is ongoing, plug out all
tbt devices, 30s later plug in tbt devices should without issue, and transfer
600M file in 3.0 successfully.
Steps: In none mode, plug/unplug test 10 times, after unplug, authorized should
set 1.
In user mode, plug/unplug test 10 times, after unplug, authorized should
set 0, and approve to access.
In secure mode, plug/unplug test 10 times, after unplug, authorzied should
set 0, and approve to access with key verify.
In dp mode, plug/unplug test 10 times, after unplug, authorzied should set 0,
approve to access.
All above mode, check tbt topo is the same as last time unplug status.
Command sample: "./runtests.sh -p cfl-h-rvp -P cfl-h-rvp -f ddt_intel/tbt_nvm_tests -o /opt/logs/tbt_nvm -c"
Steps: Save the nvm version before downgrade, copy nvm downgrade file in
/sys/bus/thunderbolt/devices/0-0/nvm_non_active0/nvmem, set 1 into
/sys/bus/thunderbolt/devices/0-0/nvm_authenticate to start NVM
downgrade, after nvm_authenticate changed to 0, otherwise will
fail the case, check nvm version is expected.
Steps: Save the nvm version before upgrade, copy nvm upgrade file in
/sys/bus/thunderbolt/devices/0-0/nvm_non_active0/nvmem, set 1 into
/sys/bus/thunderbolt/devices/0-0/nvm_authenticate to start NVM
upgrade, after nvm_authenticate changed to 0, otherwise will
fail the case, check nvm version is expected.
Steps: Found tbt EP device, if no will fail the case. Save the nvm
version before downgrade, copy nvm downgrade file for EP in
/sys/bus/thunderbolt/devices/0-X/nvm_non_activeX/nvmem, set 1 into
/sys/bus/thunderbolt/devices/0-X/nvm_authenticate to start NVM
EP downgrade, after nvm_authenticate changed to 0, otherwise will
fail the case, check nvm version is expected.
Steps: Found tbt EP device, if no will fail the case. Save the nvm
version before upgrade, copy nvm upgrade file for EP in
/sys/bus/thunderbolt/devices/0-X/nvm_non_activeX/nvmem, set 1 into
/sys/bus/thunderbolt/devices/0-X/nvm_authenticate to start NVM
EP upgrade, after nvm_authenticate changed to 0, otherwise
fail the case, check nvm version should the same as before nvm
test, if no will print the warning.
Command sample: "./runtests.sh -p cfl-h-rvp -P cfl-h-rvp -f ddt_intel/tbt_preboot_tests -o /opt/logs/tbt_preboot -c"
Steps: Check user or secure mode, other mode will not test,
check tbt devices connected, check
/sys/bus/thunderbolt/devices/domain0/boot_acl contain ","
Steps: Check user or secure mode, other mode will not test,
Clean boot_acl, boot_acl should set as ",,,,,,,,,,,,,,,"
Steps: Check user or secure mode, other mode will not test,
plug and unplug tbt devices, all tbt router authorized
set 0.
Steps: Fill invalid string into boot_acl, all should reject.
Steps: Set first connnect tbt device in boot_acl, should return success.
Steps: Clean boot_acl file should return success, plug and unplug to
check boot_acl content is ",,,,,,,,,,,,,,,"
Steps: Check all tbt devices connnected, fill in all tbt uuid in boot_acl,
should return success, and check all uuid in boot_acl.
Steps: Check tbt devices connected, and check tbt mode,
plug and unplug tbt devices 100 times, approve all tbt devices to access,
all authorized should not 0, and topo is the same as last time.
Command sample: "./runtests.sh -p cfl-h-rvp -P cfl-h-rvp -f ddt_intel/tbt_suspend_resume_tests -o /opt/logs/tbt_sleep -c"
Steps: Check tbt devices connected, and "rtcwake -m freeze -s 20",
after wake up, check topo is the same as before sleep and
show common sysfs file.
Steps: Check tbt devices connected, one ssd connnected to tbt device,
"rtcwake -m freeze -s 20", after wake up, check transfer file
to ssd, and copy the file to platform, file should be consistent.
Steps: Check tbt devices connected, one tbt monitor should be connected,
"rtcwake -m freeze -s 20", after wake up, check tbt monitor sysfs file
should come back, and check monitor sysfile content as expected.
Steps: Check tbt devices connected, and set s2idle and execute mem sleep,
after wake up, check topo is the same as before sleep and
show common sysfs file.
Steps: Check tbt devices connected, one ssd connnected to tbt device,
and set s2idle and execute mem sleep, after wake up, check transfer file
to ssd, and copy the file to platform, file should be consistent.
Steps: Check tbt devices connected, one tbt monitor should be connected,
and set s2idle and execute mem sleep, after wake up, check tbt monitor
sysfs file should come back, and check monitor sysfile content as expected.
Steps: Check tbt devices connected, and set deep and execute mem sleep,
after wake up, check topo is the same as before sleep and
show common sysfs file.
Steps: Check tbt devices connected, one ssd connnected to tbt device,
and set deep and execute mem sleep, after wake up, check transfer file
to ssd, and copy the file to platform, file should be consistent.
Steps: Check tbt devices connected, one tbt monitor should be connected,
and set deep and execute mem sleep, after wake up, check tbt monitor
sysfs file should come back, and check monitor sysfile content as expected.
Steps: Connect thunderbolt deivces and test s4, rtcwake -m disk -s 40,
check TBT connection after s4 sleep.
Steps: Connect thunderbolt deivces and test s4, rtcwake -m disk -s 40,
check TBT SSD read write function
Steps: Connect thunderbolt deivces and test s4, rtcwake -m disk -s 40,
check TBT monitor 5K works well or not
Command sample:"./runtests.sh -p cfl-h-rvp -P cfl-h-rvp -f ddt_intel/tbt_userspace_tests -o /opt/logs/tbt_userspace -c"
Steps: plug out tbt devices and then plug in tbt devices, check tbt
device connected, tried "tbtadm topology", executed return success,
result should contain "Controller" "Security" "Route-string"
Steps: check tbt device connected, tried "tbtadm approve-all", executed return
success, authorized content should not 0 and no tbt abnormal dmesg.
Steps: check tbt device connected, tried "tbtadm devices", executed return success,
check all route string in the results.
Steps: check tbt device connected, tried "tbtadm acl", executed return success,
check all tbt devices uuid in the results.
Steps: check tbt device connected, tried "tbtadm remove 0-?"(1 or 3),
executed return success, and no 0-? folder in /var/lib/thunderbolt/acl.
Steps: check tbt device connected, "tbtadm remove-all", executed return success,
no any file in /var/lib/thunderbolt.
Command sample:"./runtests.sh -p cfl-s_cnl-h -P cfl-s_cnl-h -f ddt_intel/tbt_none_tests -o /opt/logs/tbt -c"
Steps: Security was set none, check tbt device connected,
all authorized should set 1.
Steps: Find tbt 5K monitor in none mode, and check authorized should set 1.
#Part 10 - TBT user mode tests: Command sample:"./runtests.sh -p cfl-s_cnl-h -P cfl-s_cnl-h -f ddt_intel/tbt_user_tests -o /opt/logs/tbt -c"
Steps: Security was set user, check tbt device connected,
set authorized to 1 successfully.
Steps: Find tbt 5K monitor in user mode, and set 1 in authorized, and return success.
Steps: Check tbt devices connected and set user mode, then plug out all tbt devices,
30s later, check no tbt router like 0-1 folder exist in sysfs.
Steps: In user mode, check tbt devices connected, check all tbt router folders exist
in sysfs files /sys/bus/thunderbolt/devices, all tbt router authorized should
set 0.
Steps: In user mode, check tbt devices connected, fill in invalid string in
authorized, all these action should reject.
Steps: In user mode, check tbt devices connected, set 1 to authorized, should return
success, check lspci should contain thunderbolt.
Steps: In user mode, check tbt devices connected, all tbt router authorized set 1,
fill in invalid string in authorized, should reject.
Command sample:"./runtests.sh -p cfl-s_cnl-h -P cfl-s_cnl-h -f ddt_intel/tbt_secure_tests -o /opt/logs/tbt -c" authorized mentioned as below was sysfs file like: /sys/bus/thunderbolt/devices/0-X/authorized file.
Steps: Security was set secure, check tbt device connected,
set wrong key in sysfs key, and fill 2 to authorized try to approve,
which should be rejected due to wrong key, otherwise case will be failed.
Steps: Security was set secure, check tbt device connected,
set new key in sysfs key, and fill 1 to authorized try to update key
and approve, which should return success.
Steps: Find tbt 5K monitor in secure mode, and verify corrected key, authorized
should set 2 when correct key is setted, set 1 when correct key is not
found and update new key.
Steps: Check tbt connected and in secure mode, then plug out all tbt devices,
30s later, check no tbt router like 0-1 folder exist in sysfs.
Steps: In secure mode, plug in all tbt devices, tbt router authorized should set 0.
Steps: In secure mode, plug in all tbt devices, input invalid string in authorized,
all these actions return fail.
Steps: In secure mode, check tbt devices connected, set 1 into authorized without
key, return success, and all tbt devices approve to access.
Steps: In secure mode, plug out all tbt devices, and plug in, set the new key in
sysfs key, then set 1 into authorized, should return success, and all tbt
approve to access, and update the new key successfully.
Steps: In secure mode, plug out all tbt devices, and plug in, set the key last
time update, set 2 into authorized, should return success, all tbt appove
to access.
Command sample:"./runtests.sh -p cfl-s_cnl-h -P cfl-s_cnl-h -f ddt_intel/tbt_dp_tests -o /opt/logs/tbt -c"
Steps: Security was set dponly, check tbt device connected,
set 1 to authorized file, and no usb and sata connected by tbt find.
Steps: Connect tbt 5K monitor, and approve 5K monitor accees,
check 5K monitor device is recognized.
Command sample: reserved Cases: reserved Plan 4 cases to check: usb detected automatically, usb2.0/3.0 transfer ok, sata interface should not be detected.
Command sample:"./runtests.sh -p cfl-h-rvp -P cfl-h-rvp -f ddt_intel/tbt_rtd3_tests -o /opt/logs/tbt -c"
Steps: check after disconnected tbt, /sys/bus/thunderbolt/devices/0-0/power/control
should set auto. If not, will fail the case.
Steps: check after disconnected tbt, /sys/bus/thunderbolt/devices/0-0/power/control
should set auto. After 8s idle, host controller bus should be in D3
Steps: check after disconnected tbt, /sys/bus/thunderbolt/devices/0-0/power/control
should set auto, check host preboot acl, and tbt host bus should be in D0,
after idle 8s tbt host bus should be in D3 again
Steps: check after disconnected tbt, /sys/bus/thunderbolt/devices/0-0/power/control
set to on successfully, and idle 8s, host bus should be in D0.
set 0-0/power/control to auto back, idle 8s, host bus should be in D3.
Steps: Plug out all tbt devices, host router should contain xhci, if not,
will block this test. If it contain xhci, will set xhci power/control to auto,
and check 8s later in D3.
Steps: Plug out all tbt devices, let host 0-0 in idle 8s, unload thunderbolt driver,
check host PCI should be in D0.
Steps: Plug out all tbt devices, load thunderbolt driver,at first host in D0,
and then let host idle 8s, check host PCI should be in D3.
Steps: Check host controller was in D3 mode, and then freeze sleep, after wake up
and wait 8s, controller should in D3 again.
Steps: Check host controller was in D3 mode, and then S3 sleep, after wake up
and wait 8s, host controller should in D3 again.
Steps: Plug in thunderbolt devices, check host PCI in D0 status, due to xhci and
ahci is on not auto mode.
Steps: Set all xhci and ahci in tbt pci bus power/control with auto.
for example: "echo auto > /sys/bus/pci/devices/0000:37:00.0/power/control",
all should return success. And after idle 8s, xhci should be in D3
Steps: Set all ahci in tbt pci bus power/control with auto. Check AHCI should be
in D3 after 30s idle.
Then transfer file in ahci device connected by tbt, ahci should in D0.
After 30s later should be back in D3 too.
Steps: Check host controller was in D3 mode, and then s4 sleep,
after wake up and wait 8s, Controller should in D3 again.
Set TBT SW CM mode on TBT AIC board. Command sample:"./runtests.sh -p cfl-s_cnl-h -P cfl-s_cnl-h -f ddt_intel/tbt_none_tests -o /opt/logs/tbt -c" Command sample:"./runtests.sh -p cfl-s_cnl-h -P cfl-s_cnl-h -f ddt_intel/tbt_user_tests -o /opt/logs/tbt -c"
Steps: Security was set user, check tbt device connected,
set authorized to 1 successfully.
Steps: Find tbt 5K monitor in user mode, and set 1 in authorized, and return success.
Steps: Check tbt devices connected and set user mode, then plug out all tbt devices,
30s later, check no tbt router like 0-1 folder exist in sysfs.
Steps: In user mode, check tbt devices connected, check all tbt router folders exist
in sysfs files /sys/bus/thunderbolt/devices, all tbt router authorized should
set 0.
Steps: In user mode, check tbt devices connected, fill in invalid string in
authorized, all these action should reject.
Steps: In user mode, check tbt devices connected, set 1 to authorized, should return
success, check lspci should contain thunderbolt.
Steps: In user mode, check tbt devices connected, all tbt router authorized set 1,
fill in invalid string in authorized, should reject.
Steps: Connect 2 DP monitor on TR SV HR cards, both could display
Steps: Connect 2 DP monitor on TR SV HR cards, both could display, connected 3rd DP
monitor, which could not display, when plugged out 1st one, 3rd could display
Steps: upgrade TR AIC from TR_HR_4C_C1_rev41_pre4_Native_RTD3_VHPD_W_TI_6p59_NOSEC_sign#2_AIC_CM_DIS.bin
to TR_HR_4C_C1_rev41_preFF_Native_RTD3_VHPD_W_TI_6p59_NOSEC_sign#2_AIC_CM_DIS.bin without issue.
Steps: check /sys/bus/thunderbolt/devices/x-x/link_speed exist and should be 10 Gb/s or 20 Gb/s
Steps: cehck /sys/bus/thunderbolt/devices/x-x/link_width exist and should be 1 or 2
Set TBT Dual Controller tests on CML-H Command sample:"./runtests.sh -p cfl-s_cnl-h -P cfl-s_cnl-h -f ddt_intel/tbt_dual_controller_tests -o /opt/logs/tbt -c" Command sample:"./runtests.sh -p cfl-s_cnl-h -P cfl-s_cnl-h -f ddt_intel/tbt_dual_controller_tests -o /opt/logs/tbt -c"
Steps: Check /sys/bus/thunderbolt/devices/domain0 and domain1 folders
exist.
Steps: Check /sys/bus/thunderbolt/devices/0-0 and 1-0 folders exist
Steps: domain0 and 0-0 used the same pci,
domain1 and 1-0 used the same pci.
Step: check domian0 and 1 secure mode should same