mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-08-15 11:47:36 +00:00
- Added testutil/server.go with shared server lifecycle management - Created testutil/server_test.go for server management tests - Added versioning/s3_test_main.go with automatic TestMain implementation - Simplified versioning/Makefile to use weed mini for test automation - Tests now auto-manage weed mini server via TestMain - Support for USE_EXTERNAL_SERVER=true to run against existing server - Significant reduction in test infrastructure complexity - All tests passing with weed mini
28 lines
499 B
Go
28 lines
499 B
Go
package testutil
|
|
|
|
import (
|
|
"testing"
|
|
"time"
|
|
)
|
|
|
|
func TestServerStartStop(t *testing.T) {
|
|
config := DefaultServerConfig(nil)
|
|
config.StartupWait = 30 * time.Second
|
|
|
|
// Start server
|
|
server, err := StartServer(t, config)
|
|
if err != nil {
|
|
t.Fatalf("Failed to start server: %v", err)
|
|
}
|
|
|
|
// Verify server is running
|
|
if server.cmd.Process == nil {
|
|
t.Fatal("Server process not started")
|
|
}
|
|
|
|
// Stop server
|
|
if err := server.Stop(); err != nil {
|
|
t.Fatalf("Failed to stop server: %v", err)
|
|
}
|
|
}
|