commit | 9edb7330340d9abb16e69bd3b506bcd2ca0ae721 | [log] [tgz] |
---|---|---|
author | Lei YU <mine260309@gmail.com> | Thu Sep 19 14:46:19 2019 +0800 |
committer | Lei YU <mine260309@gmail.com> | Wed Oct 23 06:53:42 2019 +0000 |
tree | 471170fea258eb59b5816492bcc8e6cea4afb536 | |
parent | fda15a33f2f1f20b214f9893455fa24696ea834b [diff] |
Activation: check compatiblity of uploaded software Before activation, check if the PSU inventory's manufacturer and model matches the uploaded software, to make sure the software is not updated to a incompatible PSU. The model check is mandatory, and if the PSU manufacturer is empty, ignore the manufacturer check. Tested: Upload a dummy tarball with incompatible model, verify the activation fails; Upload a dummy tarball with compatible model, verify the activation succeeds with a dummy update service. Also added unit tests for several cases: * Update on a PSU that model is incompatible; * Update on a PSU that the manufacture is incompatible; * Update on a PSU that the menufacture is empty; * Update on 4 PSUs that the second one is incompatible. Signed-off-by: Lei YU <mine260309@gmail.com> Change-Id: Ia1b6a3fa6c98cdea1ea93c917c0938d4a60f0911
phosphor-psu-code-mgmt is a service to provide management for PSU code, including:
meson build/ && ninja -C build
meson -Doe-sdk=enabled -Dtests=enabled build/ ninja -C build/ test # Meson skips running the case due to it thinks it's cross compiling # Manually run the tests for t in `find build/test/ -maxdepth 1 -name "test_*"`; do ./$t || break ; done