0b657f4d | 21-Feb-2018 |
Andrew Jeffery <andrew@aj.id.au> |
create_read_window_vpnor: Integrate VpnorRoot
Change-Id: Ibb2ea631d3bb903a6607edac085d3025479e5ff7 Signed-off-by: Andrew Jeffery <andrew@aj.id.au> |
812923d0 | 21-Feb-2018 |
Andrew Jeffery <andrew@aj.id.au> |
test: tmpd: Replace createVpnorRoot() with VpnorRoot class
The VpnorRoot class prepares a temporary directory for use as a VPNOR backing store. Implementing it as a class allows us to use RAII to ge
test: tmpd: Replace createVpnorRoot() with VpnorRoot class
The VpnorRoot class prepares a temporary directory for use as a VPNOR backing store. Implementing it as a class allows us to use RAII to get it to clean up after itself.
Change-Id: Ia5a839e751f8dc2126a4c0b474e9a7b8593cfd57 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
show more ...
|
d083efd2 | 21-Feb-2018 |
Andrew Jeffery <andrew@aj.id.au> |
test: Add temporary directory helper for virtual PNOR tests
Move the createVpnorTree() helper function out from the create_pnor_partition_table test case into its own header. This way multiple tests
test: Add temporary directory helper for virtual PNOR tests
Move the createVpnorTree() helper function out from the create_pnor_partition_table test case into its own header. This way multiple tests can make use of its function.
Change-Id: Ieb4149e736c7ff87ecdbf7aa586b58baf936cd97 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
show more ...
|
9ecef796 | 21-Feb-2018 |
Andrew Jeffery <andrew@aj.id.au> |
create_pnor_partition_table: Extract helper for vpnor trees
The helper function makes use of parseTocLine() which we just spent a bunch of effort on extracting from the Table class. This means the t
create_pnor_partition_table: Extract helper for vpnor trees
The helper function makes use of parseTocLine() which we just spent a bunch of effort on extracting from the Table class. This means the tests and the daemon both share the same parsing code, and thus the same bugs.
By passing in an array of ToC line strings we can have enough information to populate a directory tree of test zeroed out files in the read-only directory and write the corresponding ToC file. This way when the code under test is pointed at the read-only directory it can correctly construct the environment dictated by the test code and begin servicing access requests.
Change-Id: I229393be5f53913c9f61102bbb5f8f7f9177c39e Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
show more ...
|
4fe996c2 | 26-Feb-2018 |
Andrew Jeffery <andrew@aj.id.au> |
misc: Replace license blurb with kernel-style SPDX markers
This was roughly achieved by the following shell script:
$ git ls-files | grep '\.[ch]p*$' | while read F; do EXT=${F##*.}; cat spdx.$EX
misc: Replace license blurb with kernel-style SPDX markers
This was roughly achieved by the following shell script:
$ git ls-files | grep '\.[ch]p*$' | while read F; do EXT=${F##*.}; cat spdx.$EXT <(sed '/^\/\*$/,/^ \*\/$/d' $F) > ${F}.tmp; mv ${F}.tmp $F; done
With the following context:
$ cat spdx.c // SPDX-License-Identifier: Apache-2.0 // Copyright (C) 2018 IBM Corp. $ cat spdx.h /* SPDX-License-Identifier: Apache-2.0 */ /* Copyright (C) 2018 IBM Corp. */ $ ls -l spdx.* -rw-r--r-- 1 andrew andrew 71 Feb 27 12:02 spdx.c lrwxrwxrwx 1 andrew andrew 6 Feb 27 12:02 spdx.cpp -> spdx.c -rw-r--r-- 1 andrew andrew 77 Feb 27 12:02 spdx.h lrwxrwxrwx 1 andrew andrew 6 Feb 27 12:02 spdx.hpp -> spdx.h
The `sed` invocation catches a lot of function documentation, so the hunks were manually added to avoid removing information that we want to keep.
Change-Id: I63e49ca2593aa0db0568c7a63bfdead388642e76 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
show more ...
|
acee6839 | 21-Feb-2018 |
Andrew Jeffery <andrew@aj.id.au> |
misc: Add license blurb to unlicensed files
This was roughly achieved with:
$ git ls-files | grep '.[ch]p*$' | while read F; do head -n 1 $F | fgrep -v '/*' > /dev/null && echo $F; done | while
misc: Add license blurb to unlicensed files
This was roughly achieved with:
$ git ls-files | grep '.[ch]p*$' | while read F; do head -n 1 $F | fgrep -v '/*' > /dev/null && echo $F; done | while read L; do cat apache $L > ${L}.tmp; mv ${L}.tmp ${L}; done
Some fixups performed by hand to eliminate modifications to files that were hit which should not have been.
Change-Id: I9fa5af4644687d8b595a6cf70d6f7575a767d11a Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
show more ...
|
85985915 | 21-Feb-2018 |
Andrew Jeffery <andrew@aj.id.au> |
test: Move related tests to vpnor directory
Change-Id: I5fe7f625ad642cef17fe53bd244dcde8fd99f3ad Signed-off-by: Andrew Jeffery <andrew@aj.id.au> |
5345c51e | 21-Feb-2018 |
Andrew Jeffery <andrew@aj.id.au> |
test: Move tests to a separate Makefile fragment
Change-Id: I46d5b165ed668ace67ae237b16d65a24586dd87d Signed-off-by: Andrew Jeffery <andrew@aj.id.au> |
7f9c343a | 28-Feb-2018 |
Andrew Jeffery <andrew@aj.id.au> |
pnor_partition_table: Rework semantics of Table::size()
Table::size() now returns the exact table size in bytes, Table::capacity() returns the block-aligned size in bytes (capacity in terms of how m
pnor_partition_table: Rework semantics of Table::size()
Table::size() now returns the exact table size in bytes, Table::capacity() returns the block-aligned size in bytes (capacity in terms of how much the table could grow before expanding to another block), and Table::blocks() returns the size in blocks.
This helps out with code clarity around the codebase and enables the introduction of ToC-related integration tests.
The one wrinkle is vpnor_get_partition_table_size(), which is modified to call Table::blocks() but retains 'size' in its name. This is largely unimportant as the function will go away shortly.
Change-Id: I3becf47f2201df5fe0bed86fcb92d7b94d06ab11 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
show more ...
|
b87aa329 | 26-Feb-2018 |
Andrew Jeffery <andrew@aj.id.au> |
pnor_partition_table: Log errors for invalid properties
Change-Id: Ifabbbf43800a0bc3ed7672207a3d78fd4a475e10 Signed-off-by: Andrew Jeffery <andrew@aj.id.au> |
e8a79ff3 | 26-Feb-2018 |
Andrew Jeffery <andrew@aj.id.au> |
pnor_partition{,_table}: Conform to logging requirements
See the Rules section of README.md for justification.
Change-Id: Ib5ac059b498abc152269e926fc750cb83cd75d6c Signed-off-by: Andrew Jeffery <an
pnor_partition{,_table}: Conform to logging requirements
See the Rules section of README.md for justification.
Change-Id: Ib5ac059b498abc152269e926fc750cb83cd75d6c Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
show more ...
|
f96bd16d | 25-Feb-2018 |
Andrew Jeffery <andrew@aj.id.au> |
pnor_partition_table: Make parseTocLine throw exceptions
Change-Id: I66dc8af4fede36c3c952df596040356e11a72644 Signed-off-by: Andrew Jeffery <andrew@aj.id.au> |
d976c9c9 | 26-Feb-2018 |
Andrew Jeffery <andrew@aj.id.au> |
pnor_partition_table: Drop Table ctor with default location
Make the caller be explicit about what they want. Also, rearrange calls in mboxd_pnor_partition_table.cpp to remove noise there as well.
pnor_partition_table: Drop Table ctor with default location
Make the caller be explicit about what they want. Also, rearrange calls in mboxd_pnor_partition_table.cpp to remove noise there as well.
Change-Id: I8e36101b84b1b24cf0edbedb744f8edca15a834a Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
show more ...
|
d394a787 | 20-Feb-2018 |
Andrew Jeffery <andrew@aj.id.au> |
pnor_partition_table: Move parseTocLine() out of Table class
This is the final patch in the ongoing effort to extract parseTocLine() from the Table class, enabling re-use in setup for test cases.
C
pnor_partition_table: Move parseTocLine() out of Table class
This is the final patch in the ongoing effort to extract parseTocLine() from the Table class, enabling re-use in setup for test cases.
Change-Id: I62bbcbba39fbd337e370dcc78aec6ef3cf337caa Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
show more ...
|
48595400 | 20-Feb-2018 |
Andrew Jeffery <andrew@aj.id.au> |
pnor_partition_table: Make writeSizes() private to namespace
This is part of the ongoing effort to extract parseTocLine() from the Table class, enabling reuse in setup for test cases.
Change-Id: I1
pnor_partition_table: Make writeSizes() private to namespace
This is part of the ongoing effort to extract parseTocLine() from the Table class, enabling reuse in setup for test cases.
Change-Id: I1817023347575843e5518343c83a7f2eae6302a4 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
show more ...
|
faaa71ca | 20-Feb-2018 |
Andrew Jeffery <andrew@aj.id.au> |
pnor_partition_table: Hoist partition existence check from parseTocLine()
Enforce some separation of concerns: Parsing the text of a ToC entry is an operation independent of testing whether context
pnor_partition_table: Hoist partition existence check from parseTocLine()
Enforce some separation of concerns: Parsing the text of a ToC entry is an operation independent of testing whether context derived from the parsed data is valid.
Specifically, testing whether a file at a path derived from the ToC entry is valid inside the parser is unhelpful when we try to reuse the parser for test code, where we want to set up an environment as described by the ToC entry. Under this condition the file is of course not going to exist - we're parsing the ToC entry in order to create it.
So, lets hoist the test out to the caller, enabling re-use of the parser in the test code.
Change-Id: Ibc9b62c00b95b8296b48ccf45630cb5344347bd7 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
show more ...
|
a76199bb | 20-Feb-2018 |
Andrew Jeffery <andrew@aj.id.au> |
pnor_partition_table: Make writeUserdata() private to namespace
This is part of the ongoing effort to extract parseTocLine() from the Table class, enabling reuse in setup for test cases.
Change-Id:
pnor_partition_table: Make writeUserdata() private to namespace
This is part of the ongoing effort to extract parseTocLine() from the Table class, enabling reuse in setup for test cases.
Change-Id: I846e67b728df7bf57fd132b21438a13248d426fc Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
show more ...
|
4cc2e8f3 | 20-Feb-2018 |
Andrew Jeffery <andrew@aj.id.au> |
pnor_partition_table: Make writeDefaults() private to namespace
This is part of the ongoing effort to extract parseTocLine() from the Table class, enabling reuse in setup for test cases.
Change-Id:
pnor_partition_table: Make writeDefaults() private to namespace
This is part of the ongoing effort to extract parseTocLine() from the Table class, enabling reuse in setup for test cases.
Change-Id: I0b888c028c61db2a555fa99a5abcbe339e657f95 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
show more ...
|
54e91226 | 20-Feb-2018 |
Andrew Jeffery <andrew@aj.id.au> |
pnor_partition_table: Make writeNameAndId() private to namespace
This is part of the ongoing effort to extract parseTocLine() from the Table class, enabling reuse in setup for test cases.
Change-Id
pnor_partition_table: Make writeNameAndId() private to namespace
This is part of the ongoing effort to extract parseTocLine() from the Table class, enabling reuse in setup for test cases.
Change-Id: I676e536e651dff1b27d0e53ecbb96d8e5ae8f025 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
show more ...
|
62de1aae | 20-Feb-2018 |
Andrew Jeffery <andrew@aj.id.au> |
pnor_partition_table: Return early in parseTocLine()
This is part of the ongoing effort to extract parseTocLine() from the Table class, enabling reuse in setup for test cases.
Change-Id: I0521f8272
pnor_partition_table: Return early in parseTocLine()
This is part of the ongoing effort to extract parseTocLine() from the Table class, enabling reuse in setup for test cases.
Change-Id: I0521f82727029db1ab6c59971c923fcec01b6fc9 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
show more ...
|
581a4f2c | 20-Feb-2018 |
Andrew Jeffery <andrew@aj.id.au> |
pnor_partition_table: Extract preparePartitions() loop body
Create a new private method, parseTocLine(), to handle the function of the loop body. The eventual goal is to extract the function from th
pnor_partition_table: Extract preparePartitions() loop body
Create a new private method, parseTocLine(), to handle the function of the loop body. The eventual goal is to extract the function from the class completely and simply have parseTocLine() as a public function in the openpower::virtual_pnor namespace. This will facilitate testing of the virtual PNOR parts of the codebase.
Change-Id: Ib8c3b39eb9390cfc088a54abd45aab6f551775d3 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
show more ...
|
f34db31d | 08-Mar-2018 |
Andrew Jeffery <andrew@aj.id.au> |
Format C++ files according to OpenBMC style guide
We don't touch the C yet as upstream hasn't got such a change in place.
Change-Id: Ie6cab4bf99df520bb6655b9b00ae31e762e3c57b Signed-off-by: Andrew
Format C++ files according to OpenBMC style guide
We don't touch the C yet as upstream hasn't got such a change in place.
Change-Id: Ie6cab4bf99df520bb6655b9b00ae31e762e3c57b Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
show more ...
|
25eca77f | 26-Feb-2018 |
Andrew Jeffery <andrew@aj.id.au> |
README: Begin documenting development style rules
The first rule enforces the use of stdout/stderr for logging. Rationale is provided in the README.
Change-Id: Ibb5b62ea1341aa951fd42b15e9cd14a83684
README: Begin documenting development style rules
The first rule enforces the use of stdout/stderr for logging. Rationale is provided in the README.
Change-Id: Ibb5b62ea1341aa951fd42b15e9cd14a836842032 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
show more ...
|
c2c08685 | 01-Mar-2018 |
Andrew Jeffery <andrew@aj.id.au> |
test: system: Return memory size rather than mtd size in LPC ioctl
The old behaviour was an outright bug in the system framework. The size of the LPC reserved memory window has nothing to do with th
test: system: Return memory size rather than mtd size in LPC ioctl
The old behaviour was an outright bug in the system framework. The size of the LPC reserved memory window has nothing to do with the size of the flash.
Change-Id: Ie16686ac6df8fb3117fb46aa2eaab082873fd4d0 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
show more ...
|
ee7af883 | 28-Feb-2018 |
Andrew Jeffery <andrew@aj.id.au> |
test: mbox: Type buf parameter to dump_buf() as `const void *`
This makes it a bit more ergonomic to use by not forcing the caller to cast.
Change-Id: I5d40715f4de84f174157a39d459dc1b40a94a949 Sign
test: mbox: Type buf parameter to dump_buf() as `const void *`
This makes it a bit more ergonomic to use by not forcing the caller to cast.
Change-Id: I5d40715f4de84f174157a39d459dc1b40a94a949 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
show more ...
|