예제 #1
0
func main() {
	var flagRunLanguageTests = flag.Bool("test", false, "Run the language sanity tests")
	var testLanguage = flag.String("lang", "", "Run the tests for one specific language")
	var disableApparmor = flag.Bool("disable-apparmor", false, "Disable all apparmor usage. NOT FOR PROD obv.")
	flag.Parse()

	if *disableApparmor {
		fmt.Printf("Running without apparmor support!\n")
	}

	engine, err := engine.New("config", *disableApparmor)
	if err != nil {
		panic(err)
	}

	// go func() {
	// 	for {
	// 		time.Sleep(15 * time.Second)
	// 		fmt.Printf("\n\n========\n")
	// 		pprof.Lookup("goroutine").WriteTo(os.Stderr, 1)
	// 	}
	// }()

	if *flagRunLanguageTests {
		runLanguageTests(engine, *testLanguage)
	} else {
		startServer(engine, ":8081")
	}
}
예제 #2
0
func main() {
	var flagRunLanguageTests = flag.Bool("test", false, "Run the language sanity tests")
	var testLanguage = flag.String("lang", "", "Run the tests for one specific language")
	var disableApparmor = flag.Bool("disable-apparmor", false, "Disable all apparmor usage. NOT FOR PROD obv.")
	flag.Parse()

	if *disableApparmor {
		fmt.Printf("Running without apparmor support!\n")
	}

	engine, err := engine.New("config", *disableApparmor)
	if err != nil {
		panic(err)
	}

	if *flagRunLanguageTests {
		runLanguageTests(engine, *testLanguage)
	} else {
		startServer(engine, ":8081")
	}
}