aboutsummaryrefslogtreecommitdiff
path: root/tests/avocado/machine_aspeed.py
diff options
context:
space:
mode:
authorJamin Lin <jamin_lin@aspeedtech.com>2024-09-03 16:35:28 +0800
committerCédric Le Goater <clg@redhat.com>2024-09-16 17:44:08 +0200
commita93bb519e683fd8f8d7945e5517fd5ad74cc41c0 (patch)
tree401429d831ce9e4e96d2371e8868727121bc0f98 /tests/avocado/machine_aspeed.py
parent2c075ff3ceb3b18f632c0edbd2c914329dd14e50 (diff)
machine_aspeed.py: Update to test I2C for AST2700
Update test case to test lm75 temperature sensor. Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com> Reviewed-by: Cédric Le Goater <clg@redhat.com>
Diffstat (limited to 'tests/avocado/machine_aspeed.py')
-rw-r--r--tests/avocado/machine_aspeed.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/avocado/machine_aspeed.py b/tests/avocado/machine_aspeed.py
index c0b01e8f1f..4e144bde91 100644
--- a/tests/avocado/machine_aspeed.py
+++ b/tests/avocado/machine_aspeed.py
@@ -433,9 +433,25 @@ class AST2x00MachineSDK(QemuSystemTest, LinuxSSHMixIn):
f'loader,addr=0x430000000,cpu-num={i}')
self.vm.add_args('-smp', str(num_cpu))
+ self.vm.add_args('-device',
+ 'tmp105,bus=aspeed.i2c.bus.1,address=0x4d,id=tmp-test')
self.do_test_aarch64_aspeed_sdk_start(image_dir + 'image-bmc')
self.wait_for_console_pattern('nodistro.0 ast2700-default ttyS12')
+
self.ssh_connect('root', '0penBmc', False)
+ self.ssh_command('dmesg -c > /dev/null')
+
+ self.ssh_command_output_contains(
+ 'echo lm75 0x4d > /sys/class/i2c-dev/i2c-1/device/new_device '
+ '&& dmesg -c',
+ 'i2c i2c-1: new_device: Instantiated device lm75 at 0x4d');
+
+ self.ssh_command_output_contains(
+ 'cat /sys/class/hwmon/hwmon20/temp1_input', '0')
+ self.vm.cmd('qom-set', path='/machine/peripheral/tmp-test',
+ property='temperature', value=18000)
+ self.ssh_command_output_contains(
+ 'cat /sys/class/hwmon/hwmon20/temp1_input', '18000')
class AST2x00MachineMMC(QemuSystemTest):