From a03055f657d2e970e45e7ea2a3e66857f821eabd Mon Sep 17 00:00:00 2001 From: Hector Fernandez Date: Mon, 9 Mar 2020 09:03:28 +0100 Subject: Solved problems with consumption test. Fixed error when getting mac address. --- test-cli/test/helpers/int_registers.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'test-cli/test/helpers/int_registers.py') diff --git a/test-cli/test/helpers/int_registers.py b/test-cli/test/helpers/int_registers.py index cf2e35b..030035d 100644 --- a/test-cli/test/helpers/int_registers.py +++ b/test-cli/test/helpers/int_registers.py @@ -1,6 +1,7 @@ import mmap import os import struct +import sh MAP_MASK = mmap.PAGESIZE - 1 WORD = 4 @@ -47,10 +48,14 @@ def get_mac(modelid): mac = None if modelid.find("IGEP0034") == 0 or modelid.find("SOPA0000") == 0: - # registers: mac_id0_lo, mac_id0_hi - registers = [0x44e10630, 0x44e10634] - mac = "" - for rg in registers: - mac = mac + read(rg) + # # registers: mac_id0_lo, mac_id0_hi + # registers = [0x44e10630, 0x44e10634] + # mac = "" + # for rg in registers: + # mac = mac + read(rg) + # #erase trailing zeros + # mac = mac[4::1] + mac = sh.cat("/sys/class/net/eth0/address") + return mac -- cgit v1.1