Skip to content

Commit

Permalink
Entrypoint test script refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
andyone committed May 3, 2024
1 parent 03d485b commit d175301
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 67 deletions.
88 changes: 22 additions & 66 deletions .docker/entrypoint_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,7 @@ test.configureBucketSize_Default() {

configureBucketSize

unit.contains "$conf_file" "server_names_hash_bucket_size 64;"

if [[ $? -ne 0 ]] ; then
if ! unit.contains "$conf_file" "server_names_hash_bucket_size 64;" ; then
grep 'server_names_hash_bucket_size ' "$conf_file" | sed 's/^/\n /'
return 1
fi
Expand All @@ -240,9 +238,7 @@ test.configureBucketSize_Default() {

configureBucketSize

unit.contains "$conf_file" "server_names_hash_bucket_size 64;"

if [[ $? -ne 0 ]] ; then
if ! unit.contains "$conf_file" "server_names_hash_bucket_size 64;" ; then
grep 'server_names_hash_bucket_size ' "$conf_file" | sed 's/^/\n /'
return 1
fi
Expand All @@ -260,9 +256,7 @@ test.configureBucketSize_NoConfigs() {

configureBucketSize

unit.contains "$conf_file" "server_names_hash_bucket_size 64;"

if [[ $? -ne 0 ]] ; then
if ! unit.contains "$conf_file" "server_names_hash_bucket_size 64;" ; then
grep 'server_names_hash_bucket_size ' "$conf_file" | sed 's/^/\n /'
return 1
fi
Expand All @@ -271,9 +265,7 @@ test.configureBucketSize_NoConfigs() {

configureBucketSize

unit.contains "$conf_file" "server_names_hash_bucket_size 64;"

if [[ $? -ne 0 ]] ; then
if ! unit.contains "$conf_file" "server_names_hash_bucket_size 64;" ; then
grep 'server_names_hash_bucket_size ' "$conf_file" | sed 's/^/\n /'
return 1
fi
Expand All @@ -294,9 +286,7 @@ test.configureBucketSize_DisableTuning() {

configureBucketSize

unit.contains "$conf_file" "server_names_hash_bucket_size 128;"

if [[ $? -ne 0 ]] ; then
if ! unit.contains "$conf_file" "server_names_hash_bucket_size 128;" ; then
grep 'server_names_hash_bucket_size ' "$conf_file" | sed 's/^/\n /'
return 1
fi
Expand All @@ -305,9 +295,7 @@ test.configureBucketSize_DisableTuning() {

configureBucketSize

unit.contains "$conf_file" "server_names_hash_bucket_size 128;"

if [[ $? -ne 0 ]] ; then
if ! unit.contains "$conf_file" "server_names_hash_bucket_size 128;" ; then
grep 'server_names_hash_bucket_size ' "$conf_file" | sed 's/^/\n /'
return 1
fi
Expand All @@ -331,9 +319,7 @@ test.configureBucketSize_Increased() {

configureBucketSize

unit.contains "$conf_file" "server_names_hash_bucket_size 256;"

if [[ $? -ne 0 ]] ; then
if ! unit.contains "$conf_file" "server_names_hash_bucket_size 256;" ; then
grep 'server_names_hash_bucket_size ' "$conf_file" | sed 's/^/\n /'
return 1
fi
Expand All @@ -342,9 +328,7 @@ test.configureBucketSize_Increased() {

configureBucketSize

unit.contains "$conf_file" "server_names_hash_bucket_size 256;"

if [[ $? -ne 0 ]] ; then
if ! unit.contains "$conf_file" "server_names_hash_bucket_size 256;" ; then
grep 'server_names_hash_bucket_size ' "$conf_file" | sed 's/^/\n /'
return 1
fi
Expand All @@ -364,9 +348,7 @@ test.configureBucketSize_SedError() {

configureBucketSize

unit.hasError "(entrypoint) [ERROR] Can't update configuration file $conf_file"

if [[ $? -ne 0 ]] ; then
if ! unit.hasError "(entrypoint) [ERROR] Can't update configuration file $conf_file" ; then
return 1
fi

Expand Down Expand Up @@ -561,9 +543,7 @@ test.configureProcNum_NoCG() {

configureProcNum

unit.contains "$conf_file" "worker_processes $system_procs;"

if [[ $? -ne 0 ]] ; then
if ! unit.contains "$conf_file" "worker_processes $system_procs;" ; then
grep 'worker_processes ' "$conf_file" | sed 's/^/\n /'
return 1
fi
Expand All @@ -572,9 +552,7 @@ test.configureProcNum_NoCG() {

configureProcNum

unit.contains "$conf_file" "worker_processes $system_procs;"

if [[ $? -ne 0 ]] ; then
if ! unit.contains "$conf_file" "worker_processes $system_procs;" ; then
grep 'worker_processes ' "$conf_file" | sed 's/^/\n /'
return 1
fi
Expand All @@ -593,9 +571,7 @@ test.configureProcNum_DisableTuning() {

configureProcNum

unit.contains "$conf_file" "worker_processes auto;"

if [[ $? -ne 0 ]] ; then
if ! unit.contains "$conf_file" "worker_processes auto;" ; then
grep 'worker_processes ' "$conf_file" | sed 's/^/\n /'
return 1
fi
Expand All @@ -604,9 +580,7 @@ test.configureProcNum_DisableTuning() {

configureProcNum

unit.contains "$conf_file" "worker_processes auto;"

if [[ $? -ne 0 ]] ; then
if ! unit.contains "$conf_file" "worker_processes auto;" ; then
grep 'worker_processes ' "$conf_file" | sed 's/^/\n /'
return 1
fi
Expand All @@ -629,9 +603,7 @@ test.configureProcNum_SedError() {

configureProcNum

unit.hasError "(entrypoint) [ERROR] Can't update configuration file $conf_file"

if [[ $? -ne 0 ]] ; then
if ! unit.hasError "(entrypoint) [ERROR] Can't update configuration file $conf_file" ; then
return 1
fi

Expand Down Expand Up @@ -665,9 +637,7 @@ test.configureProcNumCG1_NoLimits() {

configureProcNum

unit.contains "$conf_file" "worker_processes $system_procs;"

if [[ $? -ne 0 ]] ; then
if ! unit.contains "$conf_file" "worker_processes $system_procs;" ; then
grep 'worker_processes ' "$conf_file" | sed 's/^/\n /'
return 1
fi
Expand All @@ -676,9 +646,7 @@ test.configureProcNumCG1_NoLimits() {

configureProcNum

unit.contains "$conf_file" "worker_processes $system_procs;"

if [[ $? -ne 0 ]] ; then
if ! unit.contains "$conf_file" "worker_processes $system_procs;" ; then
grep 'worker_processes ' "$conf_file" | sed 's/^/\n /'
return 1
fi
Expand All @@ -701,9 +669,7 @@ test.configureProcNumCG1_Custom() {

configureProcNum

unit.contains "$conf_file" "worker_processes 2;"

if [[ $? -ne 0 ]] ; then
if ! unit.contains "$conf_file" "worker_processes 2;" ; then
grep 'worker_processes ' "$conf_file" | sed 's/^/\n /'
return 1
fi
Expand All @@ -712,9 +678,7 @@ test.configureProcNumCG1_Custom() {

configureProcNum

unit.contains "$conf_file" "worker_processes 2;"

if [[ $? -ne 0 ]] ; then
if ! unit.contains "$conf_file" "worker_processes 2;" ; then
grep 'worker_processes ' "$conf_file" | sed 's/^/\n /'
return 1
fi
Expand All @@ -740,9 +704,7 @@ test.configureProcNumCG2_NoLimits() {

configureProcNum

unit.contains "$conf_file" "worker_processes $system_procs;"

if [[ $? -ne 0 ]] ; then
if ! unit.contains "$conf_file" "worker_processes $system_procs;" ; then
grep 'worker_processes ' "$conf_file" | sed 's/^/\n /'
return 1
fi
Expand All @@ -751,9 +713,7 @@ test.configureProcNumCG2_NoLimits() {

configureProcNum

unit.contains "$conf_file" "worker_processes $system_procs;"

if [[ $? -ne 0 ]] ; then
if ! unit.contains "$conf_file" "worker_processes $system_procs;" ; then
grep 'worker_processes ' "$conf_file" | sed 's/^/\n /'
return 1
fi
Expand All @@ -775,9 +735,7 @@ test.configureProcNumCG2_Custom() {

configureProcNum

unit.contains "$conf_file" "worker_processes 2;"

if [[ $? -ne 0 ]] ; then
if ! unit.contains "$conf_file" "worker_processes 2;" ; then
grep 'worker_processes ' "$conf_file" | sed 's/^/\n /'
return 1
fi
Expand All @@ -786,9 +744,7 @@ test.configureProcNumCG2_Custom() {

configureProcNum

unit.contains "$conf_file" "worker_processes 2;"

if [[ $? -ne 0 ]] ; then
if ! unit.contains "$conf_file" "worker_processes 2;" ; then
grep 'worker_processes ' "$conf_file" | sed 's/^/\n /'
return 1
fi
Expand Down
2 changes: 1 addition & 1 deletion webkaos.spec
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,7 @@ rm -rf %{buildroot}
- Zlib updated to 1.3.1
- Brotli updated to the latest version
- NAXSI module removed due to discontinued development
- Discontinued supported of CentOS 7
- End of support for CentOS 7

* Wed Jun 21 2023 Anton Novojilov <[email protected]> - 1.24.0-0
- Nginx updated to 1.24.0 (mainline → stable)
Expand Down

0 comments on commit d175301

Please sign in to comment.