source "${OET_PATH}/libs/locallibs/common_lib.sh"
function pre_test() {
LOG_INFO "Start environmental preparation."
DNF_INSTALL "python-twisted"
echo "test_private_key" > ./test_key
LOG_INFO "End of environmental preparation!"
}
function run_test() {
LOG_INFO "Start to run test."
ckeygen -f ./test_key -t rsa -b 2048
CHECK_RESULT $? 0 0 "ckeygen command failed to create key"
ckeygen -f ./test_key -t rsa -b 2048 -C "Test Comment" -N "newpass" -P "oldpass"
CHECK_RESULT $? 0 0 "ckeygen command failed with combined options"
ckeygen -f ./test_key -t rsa -b 2048 -l
CHECK_RESULT $? 0 0 "ckeygen command failed to show fingerprint"
ckeygen -f ./test_key -t rsa -b 2048 -p
CHECK_RESULT $? 0 0 "ckeygen command failed to change passphrase"
ckeygen -f ./test_key -t rsa -b 2048 -y
CHECK_RESULT $? 0 0 "ckeygen command failed to show public key"
ckeygen -f ./test_key -t rsa -b 2048 --no-passphrase
CHECK_RESULT $? 0 0 "ckeygen command failed to create key with no passphrase"
ckeygen -f ./test_key -t rsa -b 2048 --private-key-subtype PEM
CHECK_RESULT $? 0 0 "ckeygen command failed to specify private key subtype"
ckeygen -f ./test_key -t rsa -b 2048 --quiet
CHECK_RESULT $? 0 0 "ckeygen command failed with quiet option"
ckeygen --version
CHECK_RESULT $? 0 0 "ckeygen command failed to display version"
LOG_INFO "End of the test."
}
function post_test() {
LOG_INFO "start environment cleanup."
DNF_REMOVE "python-twisted"
rm -f ./test_key
LOG_INFO "End of environment cleanup!"
}
main "$@"