1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
|
From f240f2a254d635f489bbf8e9ec8e6717a99b2124 Mon Sep 17 00:00:00 2001
From: Benjamin Drung <benjamin.drung@cloud.ionos.com>
Date: Thu, 27 Aug 2020 18:28:32 +0200
Subject: [PATCH] Skip FRU test cases if FRU test file is missing
The release tarball does not contain `tests/hpm_bin/firmware.hpm` and
`tests/fru_bin/kontron_am4010.bin`.
Forwarded: https://github.com/kontron/python-ipmi/pull/77
Signed-off-by: Benjamin Drung <benjamin.drung@cloud.ionos.com>
---
tests/test_fru.py | 7 +++++++
tests/test_hpm.py | 3 +++
2 files changed, 10 insertions(+)
diff --git a/tests/test_fru.py b/tests/test_fru.py
index 9e9b2b8..fa518b3 100644
--- a/tests/test_fru.py
+++ b/tests/test_fru.py
@@ -2,6 +2,7 @@
# -*- coding: utf-8 -*-
import os
+import nose
from nose.tools import eq_
from pyipmi.fru import (FruData, InventoryCommonHeader,
@@ -29,6 +30,8 @@ def test_commonheader_object():
def test_fru_inventory_from_file():
path = os.path.dirname(os.path.abspath(__file__))
fru_file = os.path.join(path, 'fru_bin/kontron_am4010.bin')
+ if not os.path.isfile(fru_file):
+ raise nose.SkipTest("FRU file '%s' is missing." % (fru_file))
fru = get_fru_inventory_from_file(fru_file)
eq_(fru.chassis_info_area, None)
@@ -36,6 +39,8 @@ def test_fru_inventory_from_file():
def test_board_area():
path = os.path.dirname(os.path.abspath(__file__))
fru_file = os.path.join(path, 'fru_bin/kontron_am4010.bin')
+ if not os.path.isfile(fru_file):
+ raise nose.SkipTest("FRU file '%s' is missing." % (fru_file))
fru = get_fru_inventory_from_file(fru_file)
board_area = fru.board_info_area
@@ -48,6 +53,8 @@ def test_board_area():
def test_product_area():
path = os.path.dirname(os.path.abspath(__file__))
fru_file = os.path.join(path, 'fru_bin/kontron_am4010.bin')
+ if not os.path.isfile(fru_file):
+ raise nose.SkipTest("FRU file '%s' is missing." % (fru_file))
fru = get_fru_inventory_from_file(fru_file)
product_area = fru.product_info_area
diff --git a/tests/test_hpm.py b/tests/test_hpm.py
index da4a3cc..5ea5059 100644
--- a/tests/test_hpm.py
+++ b/tests/test_hpm.py
@@ -3,6 +3,7 @@
import os
+import nose
from nose.tools import eq_, ok_
from pyipmi.hpm import (ComponentProperty, ComponentPropertyDescriptionString,
@@ -91,6 +92,8 @@ def test_upgradeactionrecord_create_from_data():
def test_upgrade_image():
path = os.path.dirname(os.path.abspath(__file__))
hpm_file = os.path.join(path, 'hpm_bin/firmware.hpm')
+ if not os.path.isfile(hpm_file):
+ raise nose.SkipTest("HPM binary file '%s' is missing." % (hpm_file))
image = UpgradeImage(hpm_file)
ok_(isinstance(image.actions[0], UpgradeActionRecordPrepare))
ok_(isinstance(image.actions[1], UpgradeActionRecordUploadForUpgrade))
--
2.25.1
|