Skip to content

Commit

Permalink
wedge400: cit: implement bsm eeprom, rackmon eeprom test (#1361)
Browse files Browse the repository at this point in the history
Summary:
- Implement BSMEepromTest for
-- W400 Respin or later
-- W400C DVT or later
- Implement RACKMONEepromTest for
-- W400 Respin or later
-- W400C Respin or later

#### TestPlan:
Run on Wedge400C Respin
```
root@bmc-oob:/usr/local/bin/tests2# python cit_runner.py -p wedge400c --run-test tests.wedge400.test_eeprom.BSMEepromTest
test_asset_tag (tests.wedge400.test_eeprom.BSMEepromTest) ... ok
test_extended_mac_base (tests.wedge400.test_eeprom.BSMEepromTest) ... ok
test_local_mac (tests.wedge400.test_eeprom.BSMEepromTest) ... ok
test_location_on_fabric (tests.wedge400.test_eeprom.BSMEepromTest) ... ok
test_odm_pcb (tests.wedge400.test_eeprom.BSMEepromTest) ... ok
test_product_name (tests.wedge400.test_eeprom.BSMEepromTest)
Tests if the platform defined product name is present ... ok
test_product_part_number (tests.wedge400.test_eeprom.BSMEepromTest) ... ok
test_product_serial_number (tests.wedge400.test_eeprom.BSMEepromTest) ... ok
test_system_manufacturer (tests.wedge400.test_eeprom.BSMEepromTest) ... ok
test_version (tests.wedge400.test_eeprom.BSMEepromTest) ... ok

----------------------------------------------------------------------
Ran 10 tests in 21.655s

OK
root@bmc-oob:/usr/local/bin/tests2# python cit_runner.py -p wedge400c --run-test tests.wedge400.test_eeprom.RACKMONEepromTest
test_asset_tag (tests.wedge400.test_eeprom.RACKMONEepromTest) ... ok
test_extended_mac_base (tests.wedge400.test_eeprom.RACKMONEepromTest) ... ok
test_local_mac (tests.wedge400.test_eeprom.RACKMONEepromTest) ... ok
test_location_on_fabric (tests.wedge400.test_eeprom.RACKMONEepromTest) ... ok
test_odm_pcb (tests.wedge400.test_eeprom.RACKMONEepromTest) ... ok
test_product_name (tests.wedge400.test_eeprom.RACKMONEepromTest)
Tests if the platform defined product name is present ... ok
test_product_part_number (tests.wedge400.test_eeprom.RACKMONEepromTest) ... ok
test_product_serial_number (tests.wedge400.test_eeprom.RACKMONEepromTest) ... ok
test_system_manufacturer (tests.wedge400.test_eeprom.RACKMONEepromTest) ... ok
test_version (tests.wedge400.test_eeprom.RACKMONEepromTest) ... ok

----------------------------------------------------------------------
Ran 10 tests in 20.209s

OK
root@bmc-oob:/usr/local/bin/tests2#
```
Run on another machine version not support eeprom, should be skip test
Run on Wedge400C DVT
```
root@bmc-oob:/usr/local/bin/tests2# python cit_runner.py -p wedge400c --run-test tests.wedge400.test_eeprom.RACKMONEepromTest
test_asset_tag (tests.wedge400.test_eeprom.RACKMONEepromTest) ... skipped 'Skipping because Rackmon EEPROM not available on Wedge400C-DVT '
test_extended_mac_base (tests.wedge400.test_eeprom.RACKMONEepromTest) ... skipped 'Skipping because Rackmon EEPROM not available on Wedge400C-DVT '
test_local_mac (tests.wedge400.test_eeprom.RACKMONEepromTest) ... skipped 'Skipping because Rackmon EEPROM not available on Wedge400C-DVT '
test_location_on_fabric (tests.wedge400.test_eeprom.RACKMONEepromTest) ... skipped 'Skipping because Rackmon EEPROM not available on Wedge400C-DVT '
test_odm_pcb (tests.wedge400.test_eeprom.RACKMONEepromTest) ... skipped 'Skipping because Rackmon EEPROM not available on Wedge400C-DVT '
test_product_name (tests.wedge400.test_eeprom.RACKMONEepromTest)
Tests if the platform defined product name is present ... skipped 'Skipping because Rackmon EEPROM not available on Wedge400C-DVT '
test_product_part_number (tests.wedge400.test_eeprom.RACKMONEepromTest) ... skipped 'Skipping because Rackmon EEPROM not available on Wedge400C-DVT '
test_product_serial_number (tests.wedge400.test_eeprom.RACKMONEepromTest) ... skipped 'Skipping because Rackmon EEPROM not available on Wedge400C-DVT '
test_system_manufacturer (tests.wedge400.test_eeprom.RACKMONEepromTest) ... skipped 'Skipping because Rackmon EEPROM not available on Wedge400C-DVT '
test_version (tests.wedge400.test_eeprom.RACKMONEepromTest) ... skipped 'Skipping because Rackmon EEPROM not available on Wedge400C-DVT '

----------------------------------------------------------------------
Ran 10 tests in 0.200s

OK (skipped=10)
root@bmc-oob:/usr/local/bin/tests2#
```

X-link: facebookexternal/openbmc.celestica#1361

Reviewed By: joancaneus

fbshipit-source-id: a234b0e3dd1ed92ad07090510ed96c702e1fc4b5
  • Loading branch information
mikechoifb authored and facebook-github-bot committed Jun 3, 2022
1 parent db50bd1 commit 2541c87
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions tests2/tests/wedge400/test_eeprom.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import unittest

from common.base_eeprom_test import CommonEepromTest
from tests.wedge400.helper.libpal import pal_get_board_type_rev
from utils.test_utils import qemu_check


Expand Down Expand Up @@ -127,3 +128,56 @@ def set_product_name(self):

def set_location_on_fabric(self):
self.location_on_fabric = ["FAN"]

class BSMEepromTest(EepromTest, unittest.TestCase):
"""
Test for bsm-eutil BSM Board
"""

def setUp(self):
platform_type_rev = pal_get_board_type_rev()
if (
platform_type_rev == "Wedge400-MP-Respin"
or platform_type_rev == "Wedge400C-DVT"
or platform_type_rev == "Wedge400C-DVT2"
or platform_type_rev == "Wedge400C-MP-Respin"
):
pass
else:
self.skipTest("Skipping because BSM EEPROM not available on {} ".format(platform_type_rev))
super().setUp()

def set_eeprom_cmd(self):
self.eeprom_cmd = ["/usr/local/bin/bsm-eutil"]

def set_product_name(self):
self.product_name = ["WEDGE400-BSM","WEDGE400C-BSM"]

def set_location_on_fabric(self):
self.location_on_fabric = ["BSM"]

class RACKMONEepromTest(EepromTest, unittest.TestCase):
"""
Test for reutil Rackmon
"""

def setUp(self):
platform_type_rev = pal_get_board_type_rev()
if (
platform_type_rev == "Wedge400-MP-Respin"
or platform_type_rev == "Wedge400C-MP-Respin"
):
pass
else:
self.skipTest("Skipping because Rackmon EEPROM not available on {} ".format(platform_type_rev))
super().setUp()


def set_eeprom_cmd(self):
self.eeprom_cmd = ["/usr/local/bin/reutil"]

def set_product_name(self):
self.product_name = ["WEDGE400-RACKMON"]

def set_location_on_fabric(self):
self.location_on_fabric = ["RACKMON"]

0 comments on commit 2541c87

Please sign in to comment.