-
Notifications
You must be signed in to change notification settings - Fork 218
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
qemu_v8: Enable Rust examples build by default
With no-std support it has significantly reduced time to build and test rust examples. So enable rust examples build by default for qemu_v8. Along with that add rust expect script to build repo to avoid check script duplication in OP-TEE rust SDK repo. Link: https://github.com/apache/incubator-teaclave-trustzone-sdk/blob/no-std/ci/qemu-check.exp Acked-by: Yuan Zhuang <yuanz@apache.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
- Loading branch information
Showing
3 changed files
with
184 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,176 @@ | ||
#!/usr/bin/expect -f | ||
# | ||
# This script test OP-TEE rust examples. The return code is 0 for | ||
# success, >0 for error. | ||
# | ||
|
||
info "Test Rust example applications:\n" | ||
info "Running acipher-rs...\n" | ||
send -- "acipher-rs 256 teststring\r" | ||
expect { | ||
-re "Success decrypt the above ciphertext as (\\d+) bytes plain text:" { | ||
info "Test success\n" | ||
} | ||
timeout { | ||
info "!!! Timeout: Test failed\n" | ||
exit 1 | ||
} | ||
} | ||
|
||
expect "# " | ||
info "Running aes-rs...\n" | ||
send -- "aes-rs\r" | ||
expect { | ||
-re "Prepare encode operation.*Encode buffer from TA.*Clear text and decoded text match" { | ||
info "Test success\n" | ||
} | ||
timeout { | ||
info "!!! Timeout: Test failed\n" | ||
exit 1 | ||
} | ||
} | ||
|
||
expect "# " | ||
info "Running authentication-rs...\n" | ||
send -- "authentication-rs\r" | ||
expect { | ||
-re "Clear text and decoded text match.*Success" { | ||
info "Test success\n" | ||
} | ||
timeout { | ||
info "!!! Timeout: Test failed\n" | ||
exit 1 | ||
} | ||
} | ||
|
||
expect "# " | ||
info "Running big_int-rs...\n" | ||
send -- "big_int-rs\r" | ||
expect { | ||
"Success" { | ||
info "Test success\n" | ||
} | ||
timeout { | ||
info "!!! Timeout: Test failed\n" | ||
exit 1 | ||
} | ||
} | ||
|
||
expect "# " | ||
info "Running diffie_hellman-rs...\n" | ||
send -- "diffie_hellman-rs\r" | ||
expect { | ||
-re "get key (\\d+) pair as public:.*private.*Derived share key as.*Success" { | ||
info "Test success\n" | ||
} | ||
timeout { | ||
info "!!! Timeout: Test failed\n" | ||
exit 1 | ||
} | ||
} | ||
|
||
expect "# " | ||
info "Running digest-rs...\n" | ||
send -- "digest-rs message1 message2\r" | ||
expect { | ||
-re "Get message hash as:.*Success" { | ||
info "Test success\n" | ||
} | ||
timeout { | ||
info "!!! Timeout: Test failed\n" | ||
exit 1 | ||
} | ||
} | ||
|
||
expect "# " | ||
info "Running hello_world-rs...\n" | ||
send -- "hello_world-rs\r" | ||
expect { | ||
-re "original value is 29.*inc value is 129.*dec value is 29.*Success" { | ||
info "Test success\n" | ||
} | ||
timeout { | ||
info "!!! Timeout: Test failed\n" | ||
exit 1 | ||
} | ||
} | ||
|
||
expect "# " | ||
info "Running hotp-rs...\n" | ||
send -- "hotp-rs\r" | ||
expect { | ||
-re "Get HOTP.*Success" { | ||
info "Test success\n" | ||
} | ||
timeout { | ||
info "!!! Timeout: Test failed\n" | ||
exit 1 | ||
} | ||
} | ||
|
||
expect "# " | ||
info "Running random-rs...\n" | ||
send -- "random-rs\r" | ||
expect { | ||
-re "Generate random UUID: \[a-z0-9]*-\[a-z0-9]*-\[a-z0-9]*-\[a-z0-9]*.*Success" { | ||
info "Test success\n" | ||
} | ||
timeout { | ||
info "!!! Timeout: Test failed\n" | ||
exit 1 | ||
} | ||
} | ||
|
||
expect "# " | ||
info "Running secure_storage-rs...\n" | ||
send -- "secure_storage-rs\r" | ||
expect { | ||
-re "We're done, close and release TEE resources" { | ||
info "Test success\n" | ||
} | ||
timeout { | ||
info "!!! Timeout: Test failed\n" | ||
exit 1 | ||
} | ||
} | ||
|
||
expect "# " | ||
info "Running supp_plugin-rs...\n" | ||
send -- "supp_plugin-rs\r" | ||
expect { | ||
-re "invoke commmand finished" { | ||
info "Test success\n" | ||
} | ||
timeout { | ||
info "!!! Timeout: Test failed\n" | ||
exit 1 | ||
} | ||
} | ||
|
||
expect "# " | ||
info "Running time-rs...\n" | ||
send -- "time-rs\r" | ||
expect { | ||
"Success" { | ||
info "Test success\n" | ||
} | ||
timeout { | ||
info "!!! Timeout: Test failed\n" | ||
exit 1 | ||
} | ||
} | ||
|
||
expect "# " | ||
info "Running signature_verification-rs...\n" | ||
send -- "signature_verification-rs\r" | ||
expect { | ||
"Success" { | ||
info "Test success\n" | ||
} | ||
timeout { | ||
info "!!! Timeout: Test failed\n" | ||
exit 1 | ||
} | ||
} | ||
|
||
info "Rust examples tested successfully\n" |