Skip to content

Instantly share code, notes, and snippets.

View aondio's full-sized avatar

arianna-aondio aondio

View GitHub Profile
@aondio
aondio / ova-to-box.md
Created April 8, 2019 15:09
Convert VirtualBox .ova to Vagrant box

Here's a step by step guide to convert a Virtualbox .ova to a Vagrant box.

  1. List your VMs to find the VM id you want to convert:
$ VBoxManage list vms
"testing" {a3f59eed-b9c5-4a5f-9977-187f8eb8c4d4}
  1. You can now package the .ova VM as Vagrant box:
varnishtest "Check that Age header can be set to 0s"
server s1 {
rxreq
txresp
} -start
varnish v2 -vcl+backend {
sub vcl_deliver {
set resp.http.x-tier-mid = "mid";
server s1 { # Part 1 requests
rxreq
txresp -body "1"
expect req.url == "/1"
rxreq
txresp -body "2"
expect req.url == "/1"
# Part 2 requests
rxreq
varnishtest "Make sure we play well with other directors"
server s1 {
rxreq
txresp -hdr "server: 1"
} -start
server s2 {
rxreq
txresp -hdr "server: 2"
varnishtest "host_header"
server s1 -repeat 2 {
rxreq
expect req.http.host == "overridden"
txresp
rxreq
expect req.http.host == "overridden"
txresp
@aondio
aondio / Test backends timeouts
Created April 9, 2021 10:33
Test backends timeouts
varnishtest " test backends timeouts"
server s1 {
# connect to the backend before connect_timeout
rxreq
delay 1
# send first byte before first_byte_timeout
send "HTTP/1.1 200 OK\r\n"
delay 1
# send other bytes before between_bytes_timeout
@aondio
aondio / MSE governor and selection
Created March 26, 2021 09:12
MSE governor and selection
mse.conf:
=========
env: {
id = "my_mse_id";
memcache_size = "auto";
books = ( {
id = "small";
varnishtest "shard director by req.url (default)"
server s1 {
rxreq
expect req.url == "/s1"
expect req.http.Host == "host1"
txresp -status 404 -hdr "Server: s1" -body "server1"
} -start
server s2 {
@aondio
aondio / Edgestash and conditional reqs
Created March 24, 2021 08:27
Edgestash and conditional reqs
varnishtest "Conditional Edgestash test"
server s1 {
rxreq
txresp -hdr "Etag: \"100\"" -hdr "bstatus: 200" -hdr "Content-Type: json" -body "Hello, {{first}} {{last}}!"
expect req.url == "/page.es"
rxreq
txresp -hdr "Etag: \"200\"" -body {
{
varnishtest "Goto and fallbacks"
server s1 {
rxreq
txresp -hdr "backend:s1"
expect req.url == "/client"
rxreq
txresp -status 404 -hdr "backend:s1"