Skip to content

Latest commit

 

History

History

test

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Testing Yubistack

All commands are launched from current directory!

Setup a list of servers:

SERVERS="$(cat <<EOF
server-1.foo.bar
server-2.foo.bar
EOF
)"

Compile and send:

CGO_ENABLED=0 make -C .. && \
	echo "$SERVERS" | while read -r server; do scp "${GOBIN}/yubistack" "${server}:" ; done

Start tunneling:

go run cmd/tunnel/tunnel.go -c "$(echo "$SERVERS" | sed -ne 's|$|:3306&|p' | sed ':a;N;$!ba;s|\n|,|g')"

Sending config:

echo "$SERVERS" | while read -r server; do 
	cat <<- EOF | ssh "${server}" dd of=config.toml
		debug = true

		servers = [
			$(echo "$SERVERS" | sed "/$server/d" | sed -ne 's|$|:8080/wsapi/sync",&|p' | sed -ne 's|^|&    "http://|p')
		]

		[ksm.mysql]
		host = "0.0.0.0"
		port = 3306
		name = "ykksm"
		user = "root"
		password = "some_password"

		[ykval.mysql]
		host = "0.0.0.0"
		port = 3306
		name = "ykval"
		user = "root"
		password = "some_password"
	EOF
done

Benchmarking:

go run cmd/populate/populate.go -w 50 -c $(echo "${SERVERS}" | wc -l) -k 1000 | \
	go run cmd/benchmark/benchmark.go -c "$(echo "${SERVERS}" | sed -ne 's|$|:8080&|p' | sed ':a;N;$!ba;s|\n|,|g')"