diff --git a/imageroot/actions/create-vhost/10base b/imageroot/actions/create-vhost/10base index 8512be5..2b8501a 100755 --- a/imageroot/actions/create-vhost/10base +++ b/imageroot/actions/create-vhost/10base @@ -89,3 +89,5 @@ headers = { conn.request("POST", "/api/v2/users", payload, headers) +## create the directory for the user with podman exec +subprocess.run(["podman", "exec", "sftpgo", "mkdir", "/srv/sftpgo/data/"+str(NextFpmPort)]) diff --git a/tests/webserver.robot b/tests/webserver.robot index 8bdcba3..613a869 100644 --- a/tests/webserver.robot +++ b/tests/webserver.robot @@ -12,6 +12,10 @@ Backend URL is reachable ... return_rc=True return_stdout=False Should Be Equal As Integers ${rc} 0 +VirtualHost URL is reachable + ${rc} = Execute Command curl -f ${backend_url} + ... return_rc=True return_stdout=False + Should Be Equal As Integers ${rc} 0 *** Test Cases *** Check if webserver is installed correctly @@ -44,6 +48,14 @@ Check if vhost can be updated ... return_rc=True return_stdout=False Should Be Equal As Integers ${rc} 0 +Retrieve virtualhost backend URL + # Assuming the test is running on a single node cluster + ${response} = Run task module/traefik1/get-route {"instance":"${module_id}-foo.com"} + Set Suite Variable ${backend_url} ${response['url']} + +Check if virtualhost works as expected + Retry test VirtualHost URL is reachable + Check if vhost can be destroyed ${rc} = Execute Command api-cli run module/${module_id}/destroy-vhost --data '{"ServerNames": ["foo.com","john.com"],"port": 9001}' ... return_rc=True return_stdout=False