mirror of
https://github.com/pgsty/minio.git
synced 2026-07-15 16:30:29 +03:00
remove gateway completely (#15929)
This commit is contained in:
@@ -18,13 +18,11 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"os"
|
||||
"reflect"
|
||||
"strings"
|
||||
"testing"
|
||||
@@ -324,51 +322,6 @@ func TestContains(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
// Test jsonLoad.
|
||||
func TestJSONLoad(t *testing.T) {
|
||||
format := newFormatFSV1()
|
||||
b, err := json.Marshal(format)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
var gotFormat formatFSV1
|
||||
if err = jsonLoad(bytes.NewReader(b), &gotFormat); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if *format != gotFormat {
|
||||
t.Fatal("jsonLoad() failed to decode json")
|
||||
}
|
||||
}
|
||||
|
||||
// Test jsonSave.
|
||||
func TestJSONSave(t *testing.T) {
|
||||
f, err := os.CreateTemp("", "")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer os.Remove(f.Name())
|
||||
|
||||
// Test to make sure formatFSSave overwrites and does not append.
|
||||
format := newFormatFSV1()
|
||||
if err = jsonSave(f, format); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
fi1, err := f.Stat()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err = jsonSave(f, format); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
fi2, err := f.Stat()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if fi1.Size() != fi2.Size() {
|
||||
t.Fatal("Size should not differs after jsonSave()", fi1.Size(), fi2.Size(), f.Name())
|
||||
}
|
||||
}
|
||||
|
||||
// Test ceilFrac
|
||||
func TestCeilFrac(t *testing.T) {
|
||||
cases := []struct {
|
||||
@@ -480,9 +433,6 @@ func TestGetMinioMode(t *testing.T) {
|
||||
|
||||
globalIsDistErasure, globalIsErasure = false, false
|
||||
testMinioMode(globalMinioModeFS)
|
||||
|
||||
globalIsGateway, globalGatewayName = true, "azure"
|
||||
testMinioMode(globalMinioModeGatewayPrefix + globalGatewayName)
|
||||
}
|
||||
|
||||
func TestTimedValue(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user