summaryrefslogtreecommitdiffstats
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* Fix ECC usage of being cleaned partitionsAlexander Filippov2019-12-201-0/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reset procedure of PNOR works improperly for our P8 based VESNIN hardware and makes the host unbootable. The problem is in incorrect partition cleaning. Hostboot for P8 has no support for CLEARECC bit and PNOR flash has no partitions with flag 'C'. P9 based hardware is not affected until PNOR has partitions with ECC flag only. This commit modifies the reset procedure to make it use the flag 'E' (ECC) instead of 'C' (CLEARECC). * The flag 'E' means that the partition requires ECC. * The flag 'C' means that the partition might be cleaned by hostboot when ECC is wrong. For details see: https://github.com/open-power/hostboot/blob/75c0908b91275dc10bd17cb0f10b452f32ce0b91/src/include/usr/pnor/pnor_const.H#L128 Tested: All PNOR partitions with enabled flags 'E' and 'F' should be cleaned with ECC. Change-Id: I632e90c8e256df3445fc3d1f45c830d155a1d208 Signed-off-by: Alexander Filippov <a.filippov@yadro.com>
* msl: Support for v-xx.xx.xx format version IDJohn Wang2019-09-171-0/+12
| | | | | | | | | | | | | The version ID of the pnor we have released is similar to the following format. Inspur-Dubai-v-4.1.01 This change adds support for parsing version ID in v-xx.xx.xx format Signed-off-by: John Wang <wangzqbj@inspur.com> Change-Id: I1a7dd04256d1901e3dafef14baf338b853e2ff97
* Move to new association interfaceJohn Wang2019-09-171-1/+0
| | | | | | | | | | | | | | | | | | | A new association interface is defined in phosphor-dbus-interfaces It would be nice to move the local version of the interface to the new one. The behavior of how association work is described here: https://github.com/openbmc/docs/blob/master/object-mapper.md#associations Partially resolves openbmc/openbmc#3584 Tested: See the org.openbmc.Associations interface has been replaced by the xyz one in /xyz/openbmc_project/software/version_id object and only when the version number is less than PNOR_MSL, "PNOR Minimum Ship Level NOT met" is reported. Signed-off-by: John Wang <wangzqbj@inspur.com> Change-Id: If4afeb69a9bd8bc494b77826f2ec2854a71f56f5
* Static layout: support image verificationLei YU2019-04-041-1/+2
| | | | | | | | | | | Add support of image verification for static layout PNOR code update. Tested: Verify the PNOR code update succeeds with valid-signed PNOR; and fails with invalid-signed PNOR or a PNOR tarball without signature. Change-Id: I1aafeb4e8e07eaa16c170f33f4f21940f7c9c146 Signed-off-by: Lei YU <mine260309@gmail.com>
* Refactor: Use hiomapd instead of mboxdLei YU2019-03-181-0/+1
| | | | | | | | | | | | | | mbox service is renamed to hiomapd and provides "Suspend" and "Resume" method calls, which is more appropriate for raw "cmd" calls. Use the new methods to suspend and resume hiomapd. Move "getService()" function into utils so it is shared by multiple files. Tested: Verify the reset works on Romulus Change-Id: I8f89de134b13126697bfc69a21a3148a01c34cca Signed-off-by: Lei YU <mine260309@gmail.com>
* test: Add test for getPartsToClearLei YU2019-03-132-0/+130
| | | | | | | | | | Add the test for getPartsToClear(), and fix issues found by the unit test case with malformed input. Tested: Verify test builds and passes. Change-Id: I67c8bbd184e7e0c0f7f0f0fca678d1952a07cd66 Signed-off-by: Lei YU <mine260309@gmail.com>
* test: Add test for GetVersions()Lei YU2019-03-133-22/+60
| | | | | | | | | | Also split and rename the cases in utest.cpp into test_signature and test_version. Tested: Verify test is built and passed. Change-Id: Ibe59355936d9366be8e3f56760bff7384a28a28c Signed-off-by: Lei YU <mine260309@gmail.com>
* test: Add sources of static PNORLei YU2019-03-131-2/+3
| | | | | | | | | | | | | | | | Add sources in static dir to test. It generates a link error about duplcated GardReset::reset(). Then an issue is found that GardReset::~GardReset() is not virtual, this will casuse the destructor not calling its super class' dtor. To fix the above link error, add GardReset[Ubi|Static] to make ubi/static specific implementation in its own class. Tested: Verify the test build works fine. Change-Id: I41bd4d522e8b9c4053283c0cf4373807ef4f2d1c Signed-off-by: Lei YU <mine260309@gmail.com>
* test: Fix parallel build error on testsLei YU2019-03-131-8/+11
| | | | | | | | | | | | | | | | | | The test was using LDADD to link the objects, this results in below error when building with `make check -j` *** No rule to make target '../openpower_update_manager-activation.o', needed by 'utest'. Stop. Because the test depends on the objects to be pre-build, but there is no rule in test/Makefile.am to build t he objects. This commit changes it to add sources instead of linking to objects, so parallel build works fine. Tested: run `make check -j` without error. Change-Id: Ie7aaac49756fdd3b8941c1dec8f693ec66f659ab Signed-off-by: Lei YU <mine260309@gmail.com>
* Refactor: Move serialize to ubiLei YU2019-03-081-1/+1
| | | | | | | | | | Functions in serialize are specific to UBI, move it to ubi dir. Tested: On the last commit of the patch series, run code update and factory reset on Witherspoon and all work fine. Change-Id: I9176e638d9f3bfe0d424b57f8da4667a751cb5bd Signed-off-by: Lei YU <mine260309@gmail.com>
* Refactor: Move watch to ubiLei YU2019-03-071-1/+1
| | | | | | | | | | watch is ubi specific functions, move it to ubi dir. Tested: On the last commit of the patch series, run code update and factory reset on Witherspoon and all work fine. Change-Id: Ia7f6b6de845ddd40e2a32ad626d3b7af9074c7f3 Signed-off-by: Lei YU <mine260309@gmail.com>
* msl_verify: Initial commitAdriana Kobylak2018-10-172-1/+82
| | | | | | | | | Create a new binary that checks the msl (minimum ship level) of the PNOR and logs an error message if the version on the system is older. The msl can be specified via a config flag. Change-Id: I6f477400f7a8cf56557bd0caf5d6e08d73320028 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
* clang-format: Update to match docs repoGunnar Mills2018-09-111-4/+7
| | | | | | | | Update the .clang-format file. Now includes header sorting and updating PointerAlignment. Change-Id: I7119c12f1cc0a461cb7e4576dff6a02dcc95cbc4 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Spelling fixesGunnar Mills2018-04-081-1/+1
| | | | | | | | | Spelling errors found using github.com/lucasdemarchi/codespell A tool to fix common misspellings. This tool is licensed under GNU General Public License, version 2. Change-Id: I1070feb715b037adbb55badc516d8a63c0b721bc Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Added negative path test cases for pnor signature validationJayanth Othayoth2018-03-291-1/+35
| | | | | | | Resolves openbmc/openbmc#3000 Change-Id: Ia03385d74d9885975c411ac24769510bd1afc4c4 Signed-off-by: Jayanth Othayoth <ojayanth@in.ibm.com>
* Added positive path Signature validation testJayanth Othayoth2018-03-292-0/+96
| | | | | | | | Added signature validation test cases infrastructre and positive path test case for verify function. Change-Id: I0e02a07b726ed08757a21b97871154622534c989 Signed-off-by: Jayanth Othayoth <ojayanth@in.ibm.com>
* Enable clang code formatAdriana Kobylak2018-03-021-2/+2
| | | | | Change-Id: I4490e930459a7eab6f6dd15198418c5314755d3f Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
* PNOR: Fix the delete implementationSaqib Khan2017-12-051-1/+8
| | | | | | | | | | | | | | | | - In order to remove the delete object from functional image, the delete interface is moved inside the version class so that both item_updater and image_manager can make use of the same implementation. - To avoid having two delete objects attached to the same HOST version (item_updater and image_manager), we are now deleting the image_manager object once the activation is complete. Partially resolves openbmc/openbmc#2490 Change-Id: Ie515cc01d5f154e6e55b9a3fb71d831730cd46f6 Signed-off-by: Saqib Khan <khansa@us.ibm.com>
* Add Test for getId()Gunnar Mills2017-10-252-4/+44
| | | | | | | | Added a unit test for Version::getId(). A similar test is already in phosphor-bmc-code-mgmt. Change-Id: I8ead5111017356c6a7063b6e31bee10fada78ade Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Removed version gtests from openpower-pnor-code-mgmtGunnar Mills2017-05-052-65/+1
| | | | | | | | | | These gtests were moved to phosphor-bmc-code-mgmt in https://gerrit.openbmc-project.xyz/#/c/3802/ I left the base test code since tests are needed for other functions in this repo. Change-Id: Id3f4666550ce04ddec5e34dcfe103cfe0ea42304 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Read image version from the MANIFEST.Saqib Khan2017-04-091-3/+3
| | | | | | | | | According to Patrick, all information regarding the image must be read from the MANIFEST, such as version. Also we must never open/read pnor.toc. Change-Id: Icf9f83f9ec055de21e2cf13e4ab4ab4afafc2af7 Signed-off-by: Saqib Khan <khansa@us.ibm.com>
* Add gtestsGunnar Mills2017-03-293-0/+100
Added gtests for getVersion() and getId() Resolves openbmc/openbmc#1276. Change-Id: I10a824ae3da426e901defc34fa7f3c6c6a8496d3 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
OpenPOWER on IntegriCloud