-
-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
72 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ Test the "medium" sample specification. | |
... admin_email: [email protected] | ||
... plone_initial_password: admin | ||
... additional_packages: | ||
... - wget | ||
... - curl | ||
... - lsof | ||
... muninnode_query_ips: | ||
... - 127.0.0.1 | ||
|
@@ -114,38 +114,25 @@ Check supervisor's job list. | |
zeoserver_zeoserver RUNNING | ||
|
||
We should be able to get a page on port 80. | ||
wget -4 -q --delete-after -S http:// | ||
print ssh_run('curl --ipv4 -I -s http://%s; echo $?' % box) | ||
|
||
>>> print ssh_run('wget -4 -q --delete-after -S http://%s' % box) | ||
>>> print ssh_run('curl --ipv4 -I -s http://%s | egrep "^(HTTP|Content-Type|X-Varnish-Cache)"' % box) | ||
HTTP/1.1 200 OK | ||
Server: nginx/... | ||
Date: ... | ||
... | ||
X-Varnish: ... | ||
Age: 0 | ||
Via: 1.1 varnish... | ||
Content-Type: text/html;charset=utf-8 | ||
X-Varnish-Cache: MISS | ||
... | ||
|
||
And, we should have gzip encoding available: | ||
|
||
>>> rez = ssh_run('wget -4 -q --delete-after -S --header "Accept-Encoding:gzip" http://%s' % box) | ||
>>> "Content-Encoding: gzip" in rez | ||
True | ||
>>> print ssh_run('curl --ipv4 -H "Accept-Encoding:gzip" -I -s http://%s | egrep "^(HTTP|Content-Encoding)"' % box) | ||
HTTP/1.1 200 OK | ||
Content-Encoding: gzip... | ||
|
||
Asking twice for a static resource should result in a cache hit. | ||
|
||
>>> discard = ssh_run('wget -4 -q --delete-after -S http://%s/logo.png' % box) | ||
>>> print ssh_run('wget -4 -q --delete-after -S http://%s/logo.png' % box) | ||
>>> print ssh_run('curl --ipv4 -I -s http://%s/logo.png > /dev/null' % box) | ||
>>> print ssh_run('curl --ipv4 -I -s http://%s/logo.png | egrep "^(HTTP|Content-Type|X-Varnish-Cache)"' % box) | ||
HTTP/1.1 200 OK | ||
Server: nginx/... | ||
Date: ... | ||
Content-Type: image/png | ||
... | ||
X-Varnish-Cache: HIT | ||
... | ||
|
||
|
||
The restart script exercises our control of the supervisor | ||
processes, haproxy and varnish. | ||
|
@@ -176,15 +163,10 @@ processes, haproxy and varnish. | |
|
||
The varnish cache for this host should now be empty. | ||
|
||
>>> print ssh_run('wget -4 -q --delete-after -S http://%s/logo.png' % box) | ||
>>> print ssh_run('curl --ipv4 -I -s http://%s/logo.png | egrep "^(HTTP|Content-Type|X-Varnish-Cache)"' % box) | ||
HTTP/1.1 200 OK | ||
Server: nginx/... | ||
Date: ... | ||
Content-Type: image/png | ||
... | ||
X-Varnish-Cache: MISS | ||
... | ||
|
||
|
||
>>> print >> sys.stderr, "Tests done" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters