This is an automated email from the ASF dual-hosted git repository. sciabarracom pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/openserverless-testing.git
commit 826fc798326cef24dcdea3275ec084c0ff000965 Author: Michele Sciabarra <[email protected]> AuthorDate: Fri Jul 3 13:58:39 2026 +0000 fixes to test script --- tests/1-deploy.sh | 10 ++-- tests/{10-user-minio.sh => 10-user-seaweedfs.sh} | 60 ++++++++++++------------ tests/14-runtime-testing.sh | 5 +- tests/{12-nuv-mac.sh => 5-sys-seaweedfs.sh} | 20 ++++++-- tests/8-user-redis.sh | 3 +- tests/9a-user-ferretdb.sh | 3 +- tests/9b-user-postgres.sh | 4 +- tests/all.sh | 6 +-- 8 files changed, 66 insertions(+), 45 deletions(-) diff --git a/tests/1-deploy.sh b/tests/1-deploy.sh index 68d7389..1625eef 100755 --- a/tests/1-deploy.sh +++ b/tests/1-deploy.sh @@ -42,10 +42,12 @@ export PREFL_NO_MEM_CHECK=true case "$TYPE" in kind) # create vm with docker - ops config reset - ops config slim - ops setup devcluster --uninstall - ops setup devcluster + if ! curl -s http://miniops.me | grep OpenServerless >/dev/null 2>/dev/null + then + ops config reset + ops config slim + ops setup devcluster + fi ;; k3s) # create vm and install in the server diff --git a/tests/10-user-minio.sh b/tests/10-user-seaweedfs.sh similarity index 60% rename from tests/10-user-minio.sh rename to tests/10-user-seaweedfs.sh index 6446076..f5c2877 100755 --- a/tests/10-user-minio.sh +++ b/tests/10-user-seaweedfs.sh @@ -18,59 +18,50 @@ TYPE="${1:?test type}" TYPE="$(echo $TYPE | awk -F- '{print $1}')" -if ops config status | grep OPERATOR_COMPONENT_MINIO=true; then - echo "MINIO ENABLED" +if ops config status | grep OPERATOR_COMPONENT_SEAWEEDFS=true; then + echo "SEAWEEDFS ENABLED" else - echo "MINIO DISABLED - SKIPPING" + echo "SEAWEEDFS DISABLED - SKIPPING" exit 0 fi -user="demominiouser" +user="demoseaweedfsuser$(date +%s)" password=$(ops -random --str 12) -if ops admin adduser $user [email protected] $password --minio | grep "whiskuser.nuvolaris.org/$user created"; then +if ops admin adduser $user [email protected] $password --seaweedfs | grep "whiskuser.nuvolaris.org/$user created"; then echo SUCCESS CREATING $user $password else echo FAIL CREATING $user exit 1 fi +ops admin deleteuser $user 2>/dev/null || true + ops util kube waitfor FOR=condition=ready OBJ="wsku/$user" TIMEOUT=120 -case "$TYPE" in -kind) - if OPS_USER=$user OPS_PASSWORD=$password ops -login http://localhost:80 | grep "Successfully logged in as $user."; then - echo SUCCESS LOGIN - else - echo FAIL LOGIN - exit 1 - fi - ;; -*) - APIURL=$(ops debug apihost | awk '/whisk API host/{print $4}') - if OPS_USER=$user OPS_PASSWORD=$password ops -login $APIURL | grep "Successfully logged in as $user."; then - echo SUCCESS LOGIN - else - echo FAIL LOGIN - exit 1 - fi - ;; -esac +APIURL=$(ops debug apihost | awk '/whisk API host/{print $4}') +if OPS_USER=$user OPS_PASSWORD=$password ops -login $APIURL | grep "Successfully logged in as $user."; then + echo SUCCESS LOGIN +else + echo FAIL LOGIN + exit 1 +fi -if ops setup nuvolaris minio | grep hello; then - echo SUCCESS SETUP MINIO ACTION +if ops setup nuvolaris seaweedfs | grep "$user-data"; then + echo SUCCESS SETUP SEAWEEDFS S3 ACTION else - echo FAIL SETUP ACTION MINIO + echo FAIL SETUP ACTION SEAWEEDFS S3 exit 1 fi -if ops -wsk action list | grep "/$user/hello/minio"; then - echo SUCCESS USER MINIO ACTION LIST +if ops -wsk action list | grep "/$user/hello/seaweedfs"; then + echo SUCCESS USER SEAWEEDFS S3 ACTION LIST else - echo FAIL USER MINIO ACTION LIST + echo FAIL USER SEAWEEDFS S3 ACTION LIST exit 1 fi +S3_PROVIDER=$(ops -config S3_PROVIDER) S3_ACCESS_KEY=$(ops -config S3_ACCESS_KEY) S3_SECRET_KEY=$(ops -config S3_SECRET_KEY) S3_HOST=$(ops -config S3_HOST) @@ -78,6 +69,13 @@ S3_PORT=$(ops -config S3_PORT) S3_BUCKET_DATA=$(ops -config S3_BUCKET_DATA) S3_BUCKET_STATIC=$(ops -config S3_BUCKET_STATIC) +if [[ "$S3_PROVIDER" != "seaweedfs" ]]; then + echo FAIL USER S3_PROVIDER + exit 1 +else + echo SUCCESS USER S3_PROVIDER +fi + if [[ -z "$S3_ACCESS_KEY" ]]; then echo FAIL USER S3_ACCESS_KEY exit 1 @@ -85,7 +83,7 @@ else echo SUCCESS USER S3_ACCESS_KEY fi -if ops -wsk action invoke hello/minio -p s3_access "$S3_ACCESS_KEY" \ +if ops -wsk action invoke hello/seaweedfs -p s3_access "$S3_ACCESS_KEY" \ -p s3_secret "$S3_SECRET_KEY" \ -p s3_host "$S3_HOST" \ -p s3_port "$S3_PORT" \ diff --git a/tests/14-runtime-testing.sh b/tests/14-runtime-testing.sh index a17be8e..b5f5514 100755 --- a/tests/14-runtime-testing.sh +++ b/tests/14-runtime-testing.sh @@ -21,6 +21,7 @@ TYPE="$(echo $TYPE | awk -F- '{print $1}')" user="testactionuser" password=$(ops -random --str 12) +ops admin deleteuser $user 2>/dev/null || true if ops admin adduser $user [email protected] $password --minio --redis --mongodb --postgres | grep "whiskuser.nuvolaris.org/$user created" then echo SUCCESS CREATING $user else echo FAIL CREATING $user; exit 1 @@ -28,9 +29,11 @@ fi ops util kube waitfor FOR=condition=ready OBJ="wsku/$user" TIMEOUT=600 + + case "$TYPE" in (kind) - if OPS_USER=$user OPS_PASSWORD=$password ops -login http://localhost:80 | grep "Successfully logged in as $user." + if OPS_USER=$user OPS_PASSWORD=$password ops -login http://miniops.me | grep "Successfully logged in as $user." then echo SUCCESS LOGIN else echo FAIL LOGIN ; exit 1 fi diff --git a/tests/12-nuv-mac.sh b/tests/5-sys-seaweedfs.sh similarity index 56% rename from tests/12-nuv-mac.sh rename to tests/5-sys-seaweedfs.sh index fd5b2e9..273b81b 100755 --- a/tests/12-nuv-mac.sh +++ b/tests/5-sys-seaweedfs.sh @@ -15,7 +15,21 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -TYPE="${1:?test type}" -TYPE="$(echo $TYPE | awk -F- '{print $1}')" -./all.sh $TYPE +ops config disable --minio +ops config enable --seaweedfs +ops update apply +ops setup nuvolaris wait-cm JSONPATH='{.metadata.annotations.s3_bucket_data}' +ops setup nuvolaris wait-cm-value \ + JSONPATH='{.metadata.annotations.s3_provider}' \ + EXPECTED_VALUE='seaweedfs' \ + MESSAGE='Waiting for SeaweedFS S3 provider' + +if ! ops config status | grep OPERATOR_COMPONENT_SEAWEEDFS=true +then echo SKIPPING ; exit 0 +elif [[ "$(ops -config S3_PROVIDER)" != "seaweedfs" ]] +then echo FAIL S3_PROVIDER ; exit 1 +elif ops setup nuvolaris seaweedfs | grep nuvolaris-data +then echo SUCCESS ; exit 0 +else echo FAIL ; exit 1 +fi diff --git a/tests/8-user-redis.sh b/tests/8-user-redis.sh index 14e1e92..6804a55 100755 --- a/tests/8-user-redis.sh +++ b/tests/8-user-redis.sh @@ -28,6 +28,7 @@ fi user="demoredisuser" password=$(ops -random --str 12) +ops admin deleteuser $user 2>/dev/null|| true if ops admin adduser $user [email protected] $password --redis | grep "whiskuser.nuvolaris.org/$user created"; then echo SUCCESS CREATING $user else @@ -39,7 +40,7 @@ ops util kube waitfor FOR=condition=ready OBJ="wsku/$user" TIMEOUT=120 case "$TYPE" in kind) - if OPS_USER=$user OPS_PASSWORD=$password ops -login http://localhost:3233 | grep "Successfully logged in as $user."; then + if OPS_USER=$user OPS_PASSWORD=$password ops -login http://miniops.me | grep "Successfully logged in as $user."; then echo SUCCESS LOGIN else echo FAIL LOGIN diff --git a/tests/9a-user-ferretdb.sh b/tests/9a-user-ferretdb.sh index d055377..2eccd2b 100755 --- a/tests/9a-user-ferretdb.sh +++ b/tests/9a-user-ferretdb.sh @@ -28,6 +28,7 @@ fi user="demomongouser" password=$(ops -random --str 12) +ops admin deleteuser $user 2>/dev/null || true if ops admin adduser $user [email protected] $password --mongodb | grep "whiskuser.nuvolaris.org/$user created"; then echo SUCCESS CREATING $user else @@ -39,7 +40,7 @@ ops util kube waitfor FOR=condition=ready OBJ="wsku/$user" TIMEOUT=120 case "$TYPE" in kind) - if OPS_USER=$user OPS_PASSWORD=$password ops -login http://localhost:3233 | grep "Successfully logged in as $user."; then + if OPS_USER=$user OPS_PASSWORD=$password ops -login http://miniops.me | grep "Successfully logged in as $user."; then echo SUCCESS LOGIN else echo FAIL LOGIN diff --git a/tests/9b-user-postgres.sh b/tests/9b-user-postgres.sh index e008739..0e88fde 100755 --- a/tests/9b-user-postgres.sh +++ b/tests/9b-user-postgres.sh @@ -28,6 +28,8 @@ fi user="demopostgresuser" password=$(ops -random --str 12) +ops admin deleteuser $user 2>/dev/null || true + if ops admin adduser $user [email protected] $password --postgres | grep "whiskuser.nuvolaris.org/$user created"; then echo SUCCESS CREATING $user else @@ -39,7 +41,7 @@ ops util kube waitfor FOR=condition=ready OBJ="wsku/$user" TIMEOUT=120 case "$TYPE" in kind) - if OPS_USER=$user OPS_PASSWORD=$password ops -login http://localhost:3233 | grep "Successfully logged in as $user."; then + if OPS_USER=$user OPS_PASSWORD=$password ops -login http://miniops.me | grep "Successfully logged in as $user."; then echo SUCCESS LOGIN else echo FAIL LOGIN diff --git a/tests/all.sh b/tests/all.sh index 492fb66..108c993 100755 --- a/tests/all.sh +++ b/tests/all.sh @@ -72,10 +72,10 @@ echo "##############################################" echo "##############################################" echo "# #" -echo "# TESTING MINIO $TYPE #" +echo "# TESTING SEAWEEDFS $TYPE #" echo "# #" echo "##############################################" -./5-sys-minio.sh +./5-sys-seaweedfs.sh echo "##############################################" echo "# #" @@ -117,7 +117,7 @@ echo "# #" echo "# TESTING USER MINIO $TYPE #" echo "# #" echo "##############################################" -./10-user-minio.sh $TYPE +./10-user-seaweedfs.sh $TYPE echo "##############################################" echo "# #"
