Skip to content

Commit

Permalink
cit: tahan: add test_bmc_mac and test_host_mac
Browse files Browse the repository at this point in the history
Summary:
depend on facebookexternal/openbmc.celestica#1669 because 4a3f4d8 do tahan platform lost from list

# Description
Add "test_bmc_mac & test_host_mac" CIT test cases for Tahan platform.

# Motivation
To verify the BMC mac address and Userver mac address.

X-link: facebookexternal/openbmc.celestica#1670

Test Plan:
verify CIT on Tahan machine

```
root@bmc-oob:/usr/local/bin/tests2# python cit_runner.py -p tahan -r tests.tahan.test_bmc_mac
test_bmc_mac (tests.tahan.test_bmc_mac.BMCMacTest.test_bmc_mac) ... ok
test_bmc_mac_oui (tests.tahan.test_bmc_mac.BMCMacTest.test_bmc_mac_oui) ... ok

----------------------------------------------------------------------
Ran 2 tests in 0.849s

OK
root@bmc-oob:/usr/local/bin/tests2# python cit_runner.py -p tahan -r tests.tahan.test_host_mac
test_host_mac (tests.tahan.test_host_mac.HostMacTest.test_host_mac) ... ok
test_host_mac_zero_test (tests.tahan.test_host_mac.HostMacTest.test_host_mac_zero_test) ... ok

----------------------------------------------------------------------
Ran 2 tests in 1.723s

OK
root@bmc-oob:/usr/local/bin/tests2#
```

Reviewed By: mikechoifb

Differential Revision: D51303498

Pulled By: alandau

fbshipit-source-id: 9ec353b460b542e5914809af3e1bb19ac0ca45f0
  • Loading branch information
ssinprem authored and facebook-github-bot committed Apr 10, 2024
1 parent 4bb62e3 commit ea2fc8c
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 0 deletions.
37 changes: 37 additions & 0 deletions tests2/tests/tahan/test_bmc_mac.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/usr/bin/env python3
#
# Copyright (c) Meta Platforms, Inc. and affiliates. (http://www.meta.com)
#
# This program file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program in a file named COPYING; if not, write to the
# Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor,
# Boston, MA 02110-1301 USA
#
import unittest

from common.base_bmc_mac_test import BaseBMCMacTest


class BMCMacTest(BaseBMCMacTest, unittest.TestCase):
def set_bmc_mac(self):
self.bmc_mac_cmd = [". openbmc-utils.sh && bmc_mac_addr"]

def set_bmc_interface(self):
self.bmc_interface = "eth0"

def set_valid_mac_pattern(self):
# Celestica Vendor OUI
# ref: https://rst.im/oui/CELESTICA%20INC
self.mac_pattern = [
r"(b4\:db\:91\:..\:..\:..)",
]
27 changes: 27 additions & 0 deletions tests2/tests/tahan/test_host_mac.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env python3
#
# Copyright (c) Meta Platforms, Inc. and affiliates. (http://www.meta.com)
#
# This program file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program in a file named COPYING; if not, write to the
# Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor,
# Boston, MA 02110-1301 USA
#
import unittest

from common.base_host_mac_test import BaseHostMacTest


class HostMacTest(BaseHostMacTest, unittest.TestCase):
def set_host_mac(self):
self.host_mac_cmd = [". openbmc-utils.sh && userver_mac_addr"]

0 comments on commit ea2fc8c

Please sign in to comment.