Exemplo n.º 1
0
Arquivo: exec.go Projeto: NetSys/quilt
// NewExecCommand creates a new Exec command instance.
func NewExecCommand(c ssh.Client) *Exec {
	return &Exec{
		common:       &commonFlags{},
		SSHClient:    c,
		clientGetter: getter.New(),
	}
}
Exemplo n.º 2
0
Arquivo: log.go Projeto: NetSys/quilt
// NewLogCommand creates a new Log command instance.
func NewLogCommand(c ssh.Client) *Log {
	return &Log{
		SSHClient:    c,
		clientGetter: getter.New(),
		common:       &commonFlags{},
	}
}
Exemplo n.º 3
0
func main() {
	clientGetter := getter.New()

	clnt, err := clientGetter.Client(api.DefaultSocket)
	if err != nil {
		log.WithError(err).Fatal("FAILED, couldn't get quiltctl client")
	}
	defer clnt.Close()

	leader, err := clientGetter.LeaderClient(clnt)
	if err != nil {
		log.WithError(err).Fatal("FAILED, couldn't get leader client")
	}

	tester, err := newNetworkTester(leader)
	if err != nil {
		log.WithError(err).Fatal("FAILED, couldn't initialize network tester")
	}

	containers, err := leader.QueryContainers()
	if err != nil {
		log.WithError(err).Fatal("FAILED, couldn't query containers")
	}

	var failed bool
	for _, res := range runTests(tester, containers) {
		fmt.Println(res.container)
		if len(res.unauthorized) != 0 {
			failed = true
			fmt.Println(".. FAILED, could ping unauthorized containers")
			for _, unauthorized := range res.unauthorized {
				fmt.Printf(".... %s\n", unauthorized)
			}
		}
		if len(res.unreachable) != 0 {
			failed = true
			fmt.Println(".. FAILED, couldn't ping authorized containers")
			for _, unreachable := range res.unreachable {
				fmt.Printf(".... %s\n", unreachable)
			}
		}
	}

	if !failed {
		fmt.Println("PASSED")
	}
}
Exemplo n.º 4
0
// NewMachineCommand creates a new Machine command instance.
func NewMachineCommand() *Machine {
	return &Machine{
		commonFlags:  &commonFlags{},
		clientGetter: getter.New(),
	}
}
Exemplo n.º 5
0
// NewContainerCommand creates a new Container command instance.
func NewContainerCommand() *Container {
	return &Container{
		clientGetter: getter.New(),
		commonFlags:  &commonFlags{},
	}
}
Exemplo n.º 6
0
Arquivo: ssh.go Projeto: NetSys/quilt
// NewSSHCommand creates a new SSH command instance.
func NewSSHCommand() *SSH {
	return &SSH{
		clientGetter: getter.New(),
		common:       &commonFlags{},
	}
}
Exemplo n.º 7
0
Arquivo: run.go Projeto: NetSys/quilt
// NewRunCommand creates a new Run command instance.
func NewRunCommand() *Run {
	return &Run{
		common:       &commonFlags{},
		clientGetter: getter.New(),
	}
}
Exemplo n.º 8
0
Arquivo: stop.go Projeto: NetSys/quilt
// NewStopCommand creates a new Stop command instance.
func NewStopCommand() *Stop {
	return &Stop{
		clientGetter: getter.New(),
		common:       &commonFlags{},
	}
}