*: Change default for unix socket (#28486)

This commit is contained in:
Morgan Tocker
2021-10-20 10:16:46 -06:00
committed by GitHub
parent d0f8e02cba
commit 64167a000f
4 changed files with 15 additions and 1 deletions

View File

@ -565,6 +565,7 @@ var defaultConf = Config{
Host: DefHost,
AdvertiseAddress: "",
Port: DefPort,
Socket: "/tmp/tidb.sock",
Cors: "",
Store: "unistore",
Path: "/tmp/tidb",

View File

@ -16,7 +16,7 @@ store = "unistore"
path = "/tmp/tidb"
# The socket file to use for connection.
socket = ""
socket = "/tmp/tidb.sock"
# Run ddl worker on this tidb-server.
run-ddl = true

View File

@ -178,6 +178,7 @@ func TestInitialHandshake(t *testing.T) {
var outBuffer bytes.Buffer
cfg := newTestConfig()
cfg.Socket = ""
cfg.Port = 0
cfg.Status.StatusPort = 0
drv := NewTiDBDriver(store)
@ -486,6 +487,7 @@ func testDispatch(t *testing.T, inputs []dispatchInput, capability uint32) {
var outBuffer bytes.Buffer
tidbdrv := NewTiDBDriver(store)
cfg := newTestConfig()
cfg.Socket = ""
cfg.Port, cfg.Status.StatusPort = 0, 0
cfg.Status.ReportStatus = false
server, err := NewServer(cfg, tidbdrv)

View File

@ -129,6 +129,7 @@ func (ts *tidbTestSuiteBase) SetUpSuite(c *C) {
c.Assert(err, IsNil)
ts.tidbdrv = NewTiDBDriver(ts.store)
cfg := newTestConfig()
cfg.Socket = ""
cfg.Port = ts.port
cfg.Status.ReportStatus = true
cfg.Status.StatusPort = ts.statusPort
@ -274,6 +275,7 @@ func (ts *tidbTestSuite) TestStatusPort(c *C) {
defer dom.Close()
ts.tidbdrv = NewTiDBDriver(store)
cfg := newTestConfig()
cfg.Socket = ""
cfg.Port = 0
cfg.Status.ReportStatus = true
cfg.Status.StatusPort = ts.statusPort
@ -300,6 +302,7 @@ func (ts *tidbTestSuite) TestStatusAPIWithTLS(c *C) {
cli := newTestServerClient()
cli.statusScheme = "https"
cfg := newTestConfig()
cfg.Socket = ""
cfg.Port = cli.port
cfg.Status.StatusPort = cli.statusPort
cfg.Security.ClusterSSLCA = "/tmp/ca-cert-2.pem"
@ -351,6 +354,7 @@ func (ts *tidbTestSuite) TestStatusAPIWithTLSCNCheck(c *C) {
cli := newTestServerClient()
cli.statusScheme = "https"
cfg := newTestConfig()
cfg.Socket = ""
cfg.Port = cli.port
cfg.Status.StatusPort = cli.statusPort
cfg.Security.ClusterSSLCA = caPath
@ -866,6 +870,7 @@ func registerTLSConfig(configName string, caCertPath string, clientCertPath stri
func (ts *tidbTestSuite) TestSystemTimeZone(c *C) {
tk := testkit.NewTestKit(c, ts.store)
cfg := newTestConfig()
cfg.Socket = ""
cfg.Port, cfg.Status.StatusPort = 0, 0
cfg.Status.ReportStatus = false
server, err := NewServer(cfg, ts.tidbdrv)
@ -883,6 +888,7 @@ func (ts *tidbTestSerialSuite) TestTLSAuto(c *C) {
}
cli := newTestServerClient()
cfg := newTestConfig()
cfg.Socket = ""
cfg.Port = cli.port
cfg.Status.ReportStatus = false
cfg.Security.AutoTLS = true
@ -935,6 +941,7 @@ func (ts *tidbTestSerialSuite) TestTLSBasic(c *C) {
}
cli := newTestServerClient()
cfg := newTestConfig()
cfg.Socket = ""
cfg.Port = cli.port
cfg.Status.ReportStatus = false
cfg.Security = config.Security{
@ -1001,6 +1008,7 @@ func (ts *tidbTestSerialSuite) TestTLSVerify(c *C) {
// Start the server with TLS & CA, if the client presents its certificate, the certificate will be verified.
cli := newTestServerClient()
cfg := newTestConfig()
cfg.Socket = ""
cfg.Port = cli.port
cfg.Status.ReportStatus = false
cfg.Security = config.Security{
@ -1066,6 +1074,7 @@ func (ts *tidbTestSerialSuite) TestReloadTLS(c *C) {
// try old cert used in startup configuration.
cli := newTestServerClient()
cfg := newTestConfig()
cfg.Socket = ""
cfg.Port = cli.port
cfg.Status.ReportStatus = false
cfg.Security = config.Security{
@ -1166,6 +1175,7 @@ func (ts *tidbTestSerialSuite) TestErrorNoRollback(c *C) {
cli := newTestServerClient()
cfg := newTestConfig()
cfg.Socket = ""
cfg.Port = cli.port
cfg.Status.ReportStatus = false
@ -1500,6 +1510,7 @@ func (ts *tidbTestSuite) TestGracefulShutdown(c *C) {
ts.tidbdrv = NewTiDBDriver(ts.store)
cli := newTestServerClient()
cfg := newTestConfig()
cfg.Socket = ""
cfg.GracefulWaitBeforeShutdown = 2 // wait before shutdown
cfg.Port = 0
cfg.Status.StatusPort = 0