-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathmain.go
More file actions
73 lines (62 loc) · 2.78 KB
/
main.go
File metadata and controls
73 lines (62 loc) · 2.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
// Copyright (c) Facebook, Inc. and its affiliates.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree.
// This is a generated file, edits should be made in the corresponding source
// file, and this file regenerated using
// `contest-generator --from core-plugins.yml`
// followed by
// `gofmt -w contest.go`
package main
import (
"fmt"
"os"
"os/signal"
"syscall"
"github.com/linuxboot/contest/cmds/contest/server"
// the targetmanager plugins
csvtargetmanager "github.com/linuxboot/contest/plugins/targetmanagers/csvtargetmanager"
targetlist "github.com/linuxboot/contest/plugins/targetmanagers/targetlist"
// the testfetcher plugins
literal "github.com/linuxboot/contest/plugins/testfetchers/literal"
uri "github.com/linuxboot/contest/plugins/testfetchers/uri"
// the teststep plugins
ts_cmd "github.com/linuxboot/contest/plugins/teststeps/cmd"
cpucmd "github.com/linuxboot/contest/plugins/teststeps/cpucmd"
echo "github.com/linuxboot/contest/plugins/teststeps/echo"
exec "github.com/linuxboot/contest/plugins/teststeps/exec"
gathercmd "github.com/linuxboot/contest/plugins/teststeps/gathercmd"
randecho "github.com/linuxboot/contest/plugins/teststeps/randecho"
sleep "github.com/linuxboot/contest/plugins/teststeps/sleep"
sshcmd "github.com/linuxboot/contest/plugins/teststeps/sshcmd"
// the reporter plugins
noop "github.com/linuxboot/contest/plugins/reporters/noop"
targetsuccess "github.com/linuxboot/contest/plugins/reporters/targetsuccess"
)
func getPluginConfig() *server.PluginConfig {
var pc server.PluginConfig
pc.TargetManagerLoaders = append(pc.TargetManagerLoaders, csvtargetmanager.Load)
pc.TargetManagerLoaders = append(pc.TargetManagerLoaders, targetlist.Load)
pc.TestFetcherLoaders = append(pc.TestFetcherLoaders, literal.Load)
pc.TestFetcherLoaders = append(pc.TestFetcherLoaders, uri.Load)
pc.TestStepLoaders = append(pc.TestStepLoaders, ts_cmd.Load)
pc.TestStepLoaders = append(pc.TestStepLoaders, cpucmd.Load)
pc.TestStepLoaders = append(pc.TestStepLoaders, echo.Load)
pc.TestStepLoaders = append(pc.TestStepLoaders, exec.Load)
pc.TestStepLoaders = append(pc.TestStepLoaders, gathercmd.Load)
pc.TestStepLoaders = append(pc.TestStepLoaders, randecho.Load)
pc.TestStepLoaders = append(pc.TestStepLoaders, sleep.Load)
pc.TestStepLoaders = append(pc.TestStepLoaders, sshcmd.Load)
pc.ReporterLoaders = append(pc.ReporterLoaders, noop.Load)
pc.ReporterLoaders = append(pc.ReporterLoaders, targetsuccess.Load)
return &pc
}
func main() {
sigs := make(chan os.Signal, 1)
defer close(sigs)
signal.Notify(sigs, syscall.SIGINT, syscall.SIGTERM, syscall.SIGUSR1)
if err := server.Main(getPluginConfig(), os.Args[0], os.Args[1:], sigs); err != nil {
fmt.Fprintf(os.Stderr, "%v\n", err)
os.Exit(1)
}
}