diff options
author | Frederic Marec <frederic.marec@iot.bzh> | 2019-05-10 17:59:25 +0200 |
---|---|---|
committer | José Bollo <jose.bollo@iot.bzh> | 2019-05-13 08:19:37 +0000 |
commit | cb6b878f2a09f8b8b9b030a12efe948b3276745d (patch) | |
tree | 8e7052ae5ef2b7ca35795d7118129dd7115aaab5 /test/afb-test/tests | |
parent | c412ecf8c08a926c15c26b61e981b162f072a94f (diff) |
Add test fixtures to set up environment
Add script to check /etc/platform-info presence
Add script to check necessary files
Add script to set up environment
Add script to set down environment
Modify get test
Bug-AGL: SPEC-2362
Change-Id: I733cb86cc8c616ffdbfcb88cb96a2a4a5b97e652
Signed-off-by: Frederic Marec <frederic.marec@iot.bzh>
Diffstat (limited to 'test/afb-test/tests')
-rw-r--r-- | test/afb-test/tests/aft-BasicAPITests.lua | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/test/afb-test/tests/aft-BasicAPITests.lua b/test/afb-test/tests/aft-BasicAPITests.lua index 730db7e..73cdd8e 100644 --- a/test/afb-test/tests/aft-BasicAPITests.lua +++ b/test/afb-test/tests/aft-BasicAPITests.lua @@ -20,11 +20,43 @@ local testPrefix ="agl-info_BasicAPITest_" +_AFT.setBeforeAll(function() + + if not os.execute("/bin/bash ".._AFT.bindingRootDir.."/var/testPresence.sh") then + + print("Platform-info environment already set up") + return 0 + + else + if not os.execute("/bin/bash ".._AFT.bindingRootDir.."/var/createPlatformInfoDirectory.sh") then + + print("Fail to set up Platform-info test environment") + return -1 + + else + print("Platform-info environment set up") + _AFT.setAfterAll(function() + if not os.execute("/bin/bash ".._AFT.bindingRootDir.."/var/removePlatforInfoDirectory.sh") then + + print("Fail to set down Platform-info test environment") + return -1 + + else + print("Platform-info environment set down") + return 0 + + end + end) + return 0 + end + end +end) + -- This tests the 'get' verb of the platform-info API _AFT.testVerbStatusSuccess(testPrefix.."get", "platform-info", "get", ".build.layers.agl-manifest.revision") -- This tests the 'get' verb of the platform-info API -_AFT.testVerbStatusError(testPrefix.."get", "platform-info", "get", {}) +_AFT.testVerbStatusSuccess(testPrefix.."get", "platform-info", "get", {}) -- This tests the 'set' verb of the platform-info API _AFT.testVerbStatusSuccess(testPrefix.."set", "platform-info", "set", {arg=".build.layers.agl-manifest.revision", value="test"}) |