mirror of
https://github.com/cubefs/cubefs.git
synced 2026-08-02 10:06:14 +00:00
Add ObjectNode provides S3-compatibile APIs. Fusion Storage interface expose two interface (POSIX and S3-compatible) for file operation. Signed-off-by: Mofei Zhang <mofei2816@gmail.com>
55 lines
1.4 KiB
Go
55 lines
1.4 KiB
Go
// Copyright 2018 The ChubaoFS Authors.
|
|
//
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
// you may not use this file except in compliance with the License.
|
|
// You may obtain a copy of the License at
|
|
//
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
//
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
// implied. See the License for the specific language governing
|
|
// permissions and limitations under the License.
|
|
|
|
package objectnode
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
"testing"
|
|
|
|
"github.com/chubaofs/chubaofs/util/config"
|
|
"github.com/chubaofs/chubaofs/util/log"
|
|
)
|
|
|
|
func TestObjectNode_Lifecycle(t *testing.T) {
|
|
var err error
|
|
cfgStr := `
|
|
{
|
|
"listen": ":10004",
|
|
"logDir": "/tmp/Logs/chubaofs",
|
|
"module": "object"
|
|
}
|
|
`
|
|
// test log
|
|
cfg := config.LoadConfigString(cfgStr)
|
|
if _, err := log.InitLog(cfg.GetString("logDir"), "node", log.DebugLevel, nil); err != nil {
|
|
fmt.Println("Fatal: failed to init log - ", err)
|
|
os.Exit(1)
|
|
return
|
|
}
|
|
|
|
node := NewServer()
|
|
if err = node.Start(cfg); err != nil {
|
|
t.Fatalf("start node server fail cause: %v", err)
|
|
}
|
|
//go func() {
|
|
// fmt.Printf("node server will be shutdown after 3 seconds.\n")
|
|
// time.Sleep(3 * time.Second)
|
|
// fmt.Printf("node server will be shutdown.\n")
|
|
// node.Shutdown()
|
|
//}()
|
|
node.Sync()
|
|
}
|