Skip to content

Commit

Permalink
Add OS fingerprint test
Browse files Browse the repository at this point in the history
Change-type: minor
Signed-off-by: Giovanni Garufi <giovanni@balena.io>
  • Loading branch information
Giovanni Garufi committed Dec 19, 2019
1 parent a7e6098 commit 0ec2663
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
1 change: 1 addition & 0 deletions suites/os/suite.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ module.exports = {
);
},
tests: [
'./tests/fingerprint',
'./tests/led',
'./tests/config-json',
'./tests/boot-splash',
Expand Down
39 changes: 39 additions & 0 deletions suites/os/tests/fingerprint/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

'use strict';

module.exports = {
title: 'Check for OS corruption',
tests: [
{
title: 'test resinos.fingerprint file',
run: async function(test) {
let error = null;
try {
await this.context
.get()
.worker.executeCommandInHostOS(
'md5sum --quiet -c /resinos.fingerprint',
this.context.get().link,
);
} catch (e) {
error = e;
}

test.is(error, null, 'Device rootfs seems to be corrupted');
},
},
],
};

0 comments on commit 0ec2663

Please sign in to comment.