summaryrefslogtreecommitdiff
path: root/test/py/tests/test_i2c.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/py/tests/test_i2c.py')
-rw-r--r--test/py/tests/test_i2c.py44
1 files changed, 22 insertions, 22 deletions
diff --git a/test/py/tests/test_i2c.py b/test/py/tests/test_i2c.py
index 825d0c2e6eb..69b11930ce7 100644
--- a/test/py/tests/test_i2c.py
+++ b/test/py/tests/test_i2c.py
@@ -31,8 +31,8 @@ env__i2c_eeprom_device_test = {
}
"""
-def get_i2c_test_env(u_boot_console):
- f = u_boot_console.config.env.get("env__i2c_device_test", None)
+def get_i2c_test_env(ubman):
+ f = ubman.config.env.get("env__i2c_device_test", None)
if not f:
pytest.skip("No I2C device to test!")
else:
@@ -43,34 +43,34 @@ def get_i2c_test_env(u_boot_console):
return bus_list, probe_all
@pytest.mark.buildconfigspec("cmd_i2c")
-def test_i2c_bus(u_boot_console):
- bus_list, probe = get_i2c_test_env(u_boot_console)
+def test_i2c_bus(ubman):
+ bus_list, probe = get_i2c_test_env(ubman)
bus = random.choice(bus_list)
expected_response = f"Bus {bus}:"
- response = u_boot_console.run_command("i2c bus")
+ response = ubman.run_command("i2c bus")
assert expected_response in response
@pytest.mark.buildconfigspec("cmd_i2c")
-def test_i2c_dev(u_boot_console):
- bus_list, probe = get_i2c_test_env(u_boot_console)
+def test_i2c_dev(ubman):
+ bus_list, probe = get_i2c_test_env(ubman)
expected_response = "Current bus is"
- response = u_boot_console.run_command("i2c dev")
+ response = ubman.run_command("i2c dev")
assert expected_response in response
@pytest.mark.buildconfigspec("cmd_i2c")
-def test_i2c_probe(u_boot_console):
- bus_list, probe = get_i2c_test_env(u_boot_console)
+def test_i2c_probe(ubman):
+ bus_list, probe = get_i2c_test_env(ubman)
bus = random.choice(bus_list)
expected_response = f"Setting bus to {bus}"
- response = u_boot_console.run_command(f"i2c dev {bus}")
+ response = ubman.run_command(f"i2c dev {bus}")
assert expected_response in response
expected_response = "Valid chip addresses:"
- response = u_boot_console.run_command("i2c probe")
+ response = ubman.run_command("i2c probe")
assert expected_response in response
@pytest.mark.buildconfigspec("cmd_i2c")
-def test_i2c_eeprom(u_boot_console):
- f = u_boot_console.config.env.get("env__i2c_eeprom_device_test", None)
+def test_i2c_eeprom(ubman):
+ f = ubman.config.env.get("env__i2c_eeprom_device_test", None)
if not f:
pytest.skip("No I2C eeprom to test!")
@@ -89,17 +89,17 @@ def test_i2c_eeprom(u_boot_console):
)
# Enable i2c mux bridge
- u_boot_console.run_command("i2c dev %x" % bus)
- u_boot_console.run_command("i2c probe")
- output = u_boot_console.run_command("i2c md %x 0 5" % addr)
+ ubman.run_command("i2c dev %x" % bus)
+ ubman.run_command("i2c probe")
+ output = ubman.run_command("i2c md %x 0 5" % addr)
assert value in output
@pytest.mark.buildconfigspec("cmd_i2c")
-def test_i2c_probe_all_buses(u_boot_console):
- bus_list, probe = get_i2c_test_env(u_boot_console)
+def test_i2c_probe_all_buses(ubman):
+ bus_list, probe = get_i2c_test_env(ubman)
bus = random.choice(bus_list)
expected_response = f"Bus {bus}:"
- response = u_boot_console.run_command("i2c bus")
+ response = ubman.run_command("i2c bus")
assert expected_response in response
# Get all the bus list
@@ -109,8 +109,8 @@ def test_i2c_probe_all_buses(u_boot_console):
for dev in bus_list:
expected_response = f"Setting bus to {dev}"
- response = u_boot_console.run_command(f"i2c dev {dev}")
+ response = ubman.run_command(f"i2c dev {dev}")
assert expected_response in response
expected_response = "Valid chip addresses:"
- response = u_boot_console.run_command("i2c probe")
+ response = ubman.run_command("i2c probe")
assert expected_response in response