summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Jeffery <andrew@aj.id.au>2018-02-26 09:57:56 +1030
committerAndrew Jeffery <andrew@aj.id.au>2018-03-24 13:59:32 +1030
commit17bbf453661d8d5e498e0d34030d73e55b99311f (patch)
tree136f743a29ba9ecd3394d64d5432fa709f6e322a
parentb02ef4340b59ba0ddcfd1d258a328feb1888c64a (diff)
downloadphosphor-mboxd-17bbf453661d8d5e498e0d34030d73e55b99311f.zip
phosphor-mboxd-17bbf453661d8d5e498e0d34030d73e55b99311f.tar.gz
test: vpnor: Add toc_start_gt_end
Change-Id: Iaac0e7783f1ceba0d009fcd4865861b0109639e4 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
-rw-r--r--Makefile.am1
-rw-r--r--test/vpnor/Makefile.am.include13
-rw-r--r--test/vpnor/toc_start_gt_end.cpp28
3 files changed, 41 insertions, 1 deletions
diff --git a/Makefile.am b/Makefile.am
index 09add65..84c5772 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -35,6 +35,7 @@ mboxctl_CFLAGS = $(LIBSYSTEMD_CFLAGS)
@CODE_COVERAGE_RULES@
check_PROGRAMS =
+XFAIL_TESTS =
include test/Makefile.am.include
include test/vpnor/Makefile.am.include
diff --git a/test/vpnor/Makefile.am.include b/test/vpnor/Makefile.am.include
index f1034a7..5c828d9 100644
--- a/test/vpnor/Makefile.am.include
+++ b/test/vpnor/Makefile.am.include
@@ -72,6 +72,13 @@ test_vpnor_toc_no_name_SOURCES = \
test_vpnor_toc_no_name_LDFLAGS = $(OESDK_TESTCASE_FLAGS)
test_vpnor_toc_no_name_LDADD = $(VPNOR_LDADD)
+test_vpnor_toc_start_gt_end_SOURCES = \
+ common.c \
+ pnor_partition_table.cpp \
+ %reldir%/toc_start_gt_end.cpp
+test_vpnor_toc_start_gt_end_LDFLAGS = $(OESDK_TESTCASE_FLAGS)
+test_vpnor_toc_start_gt_end_LDADD = $(VPNOR_LDADD)
+
if VIRTUAL_PNOR_ENABLED
check_PROGRAMS += \
%reldir%/create_pnor_partition_table \
@@ -80,5 +87,9 @@ check_PROGRAMS += \
%reldir%/write_ro \
%reldir%/write_rw \
%reldir%/write_patch \
- %reldir%/toc_no_name
+ %reldir%/toc_no_name \
+ %reldir%/toc_start_gt_end
+
+XFAIL_TESTS += \
+ %reldir%/toc_start_gt_end
endif
diff --git a/test/vpnor/toc_start_gt_end.cpp b/test/vpnor/toc_start_gt_end.cpp
new file mode 100644
index 0000000..c5c83ef
--- /dev/null
+++ b/test/vpnor/toc_start_gt_end.cpp
@@ -0,0 +1,28 @@
+// SPDX-License-Identifier: Apache-2.0
+// Copyright (C) 2018 IBM Corp.
+
+#include "config.h"
+#include <assert.h>
+
+#include "pnor_partition_table.hpp"
+
+static constexpr auto BLOCK_SIZE = 4 * 1024;
+
+int main()
+{
+ namespace vpnor = openpower::virtual_pnor;
+
+ std::string line = "partition01=FOO,00002000,00001000,80,ECC,PRESERVED";
+ pnor_partition part;
+
+ try
+ {
+ vpnor::parseTocLine(line, BLOCK_SIZE, part);
+ }
+ catch (vpnor::InvalidTocEntry& e)
+ {
+ return 0;
+ }
+
+ assert(false);
+}
OpenPOWER on IntegriCloud