37 lines
1023 B
Go
37 lines
1023 B
Go
// Command q8lab is the program behind test/integration/signed-logins.test.ts (research 053, question 8).
|
|
//
|
|
// q8lab gen -out DIR -a IP -b IP -c IP writes keys and the three servers' configs (runs on the workstation)
|
|
// q8lab server -conf FILE runs one nats-server 2.11.17 (embedded) until killed
|
|
// q8lab agent -peer IP on machine C: an HTTP switch that cuts and restores traffic to the peer
|
|
// q8lab wait -url URL waits until the URL answers 200
|
|
// q8lab drive -keys FILE on machine A: runs the measurements and prints them
|
|
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
)
|
|
|
|
func main() {
|
|
if len(os.Args) < 2 {
|
|
fmt.Println("usage: q8lab gen|server|agent|wait|drive")
|
|
os.Exit(2)
|
|
}
|
|
args := os.Args[2:]
|
|
switch os.Args[1] {
|
|
case "gen":
|
|
gen(args)
|
|
case "server":
|
|
runServer(args)
|
|
case "agent":
|
|
runAgent(args)
|
|
case "wait":
|
|
runWait(args)
|
|
case "drive":
|
|
drive(args)
|
|
default:
|
|
fmt.Println("unknown command", os.Args[1])
|
|
os.Exit(2)
|
|
}
|
|
}
|