mirror of
https://github.com/joglomedia/LEMPer.git
synced 2026-04-13 08:28:21 +00:00
add unit test cases
This commit is contained in:
@@ -23,7 +23,8 @@ matrix:
|
||||
- cp .env.dist .env
|
||||
# Run the source through ShellCheck (http://www.shellcheck.net).
|
||||
- shellcheck -s bash -x scripts/helper.sh
|
||||
#- shellcheck -s bash scripts/install_*.sh
|
||||
- shellcheck -s bash scripts/install_*.sh
|
||||
- shellcheck -s bash scripts/remove_*.sh
|
||||
- shellcheck -s bash -x lemper.sh
|
||||
- shellcheck -s bash bin/lemper-cli.sh
|
||||
- shellcheck -s bash lib/lemper-*.sh
|
||||
|
||||
@@ -16,10 +16,22 @@ testEquality()
|
||||
assertEquals 1 1
|
||||
}
|
||||
|
||||
testEqualityGetDistribName()
|
||||
{
|
||||
distrib_name=$(get_distrib_name)
|
||||
assertEquals "ubuntu" "${distrib_name}"
|
||||
}
|
||||
|
||||
testEqualityGetReleaseName()
|
||||
{
|
||||
distro_name=$(get_release_name)
|
||||
assertEquals "bionic" "${distro_name}"
|
||||
release_name=$(get_release_name)
|
||||
assertEquals "bionic" "${release_name}"
|
||||
}
|
||||
|
||||
testEqualityCreateAccount()
|
||||
{
|
||||
release_name=$(create_account lemper)
|
||||
assertEquals "Username lemper created." "${release_name}"
|
||||
}
|
||||
|
||||
testEqualityGetNginxStableVersion()
|
||||
@@ -34,5 +46,32 @@ testEqualityGetNginxLatestVersion()
|
||||
assertEquals "1.17.6" "${ngx_latest_version}"
|
||||
}
|
||||
|
||||
testEqualityInstallNginx()
|
||||
{
|
||||
. ./scripts/install_nginx.sh
|
||||
|
||||
nginx_bin=$(command -v nginx)
|
||||
assertEquals "/usr/sbin/nginx" "${nginx_bin}"
|
||||
}
|
||||
|
||||
testEqualityInstallPhp()
|
||||
{
|
||||
. ./scripts/install_php.sh
|
||||
|
||||
php_bin=$(command -v php)
|
||||
assertEquals "/usr/bin/php" "${php_bin}"
|
||||
}
|
||||
|
||||
testEqualityInstallMySQL()
|
||||
{
|
||||
. ./scripts/install_mariadb.sh
|
||||
|
||||
mysql_bin=$(command -v mysql)
|
||||
assertEquals "/usr/bin/mysql" "${mysql_bin}"
|
||||
|
||||
mysqld_bin=$(command -v mysqld)
|
||||
assertEquals "/usr/sbin/mysqld" "${mysqld_bin}"
|
||||
}
|
||||
|
||||
# load shunit2
|
||||
. /usr/local/bin/shunit2
|
||||
|
||||
Reference in New Issue
Block a user