Skip to content

Commit

Permalink
feat: Update webserver.robot test suite for virtualhost configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
stephdl committed May 17, 2024
1 parent be70076 commit 4b46418
Showing 1 changed file with 22 additions and 9 deletions.
31 changes: 22 additions & 9 deletions tests/webserver.robot
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,13 @@ 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}
VirtualHost foo.com URL is reachable
${rc} = Execute Command curl -H "Host: foo.com" -f ${backend_url}
... return_rc=True return_stdout=False
Should Be Equal As Integers ${rc} 0

VirtualHost john.com URL is reachable
${rc} = Execute Command curl -H "Host: john.com" -f ${backend_url}
... return_rc=True return_stdout=False
Should Be Equal As Integers ${rc} 0

Expand All @@ -38,23 +43,31 @@ Retrieve webserver backend URL
Check if webserver works as expected
Retry test Backend URL is reachable

Check if vhost can be created
${rc} = Execute Command api-cli run module/${module_id}/create-vhost --data '{"PhpVersion":"8.2","ServerNames":["foo.com","john.com"],"MemoryLimit":512,"AllowUrlfOpen":"enabled","UploadMaxFilesize":4,"PostMaxSize":8,"MaxExecutionTime":0,"MaxFileUploads":20,"lets_encrypt":false,"http2https":true,"Indexes":"enabled","status":"enabled"}'
Check if vhost 9001 can be created
${rc} = Execute Command api-cli run module/${module_id}/create-vhost --data '{"PhpVersion":"8.2","ServerNames":["foo.com"],"MemoryLimit":512,"AllowUrlfOpen":"disabled","UploadMaxFilesize":4,"PostMaxSize":8,"MaxExecutionTime":0,"MaxFileUploads":20,"lets_encrypt":false,"http2https":false,"Indexes":"disabled","status":"enabled"}'
... return_rc=True return_stdout=False
Should Be Equal As Integers ${rc} 0

Check if vhost can be updated
${rc} = Execute Command api-cli run module/${module_id}/update-vhost --data '{"PhpVersion":"8.2","ServerNames":["foo.com","john.com"],"Port":9001,"MemoryLimit":512,"AllowUrlfOpen":"enabled","UploadMaxFilesize":4,"PostMaxSize":8,"MaxExecutionTime":0,"MaxFileUploads":20,"lets_encrypt":false,"http2https":true,"Indexes":"enabled","status":"enabled"}'
Check if vhost 9001 can be updated
${rc} = Execute Command api-cli run module/${module_id}/update-vhost --data '{"PhpVersion":"8.2","ServerNames":["foo.com","john.com"],"Port":9001,"MemoryLimit":1024,"AllowUrlfOpen":"enabled","UploadMaxFilesize":8,"PostMaxSize":16,"MaxExecutionTime":100,"MaxFileUploads":40,"lets_encrypt":true,"http2https":true,"Indexes":"enabled","status":"enabled"}'
... return_rc=True return_stdout=False
Should Be Equal As Integers ${rc} 0

Retrieve virtualhost backend URL
Retrieve virtualhost foo.com 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 virtualhost foo.com works as expected
Retry test VirtualHost foo.com URL is reachable

Retrieve virtualhost john.com backend URL
# Assuming the test is running on a single node cluster
${response} = Run task module/traefik1/get-route {"instance":"${module_id}-john.com"}
Set Suite Variable ${backend_url} ${response['url']}

Check if virtualhost john.com works as expected
Retry test VirtualHost john.com 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}'
Expand Down

0 comments on commit 4b46418

Please sign in to comment.