mirror of
https://github.com/percona/percona-toolkit.git
synced 2026-02-28 02:07:54 +08:00
Rename ctx to logCtx, remove any mention of ctx
This commit is contained in:
committed by
Sveta Smirnova
parent
bb6c5e1abd
commit
955fd75ca9
@@ -11,7 +11,7 @@ func TestIdentsRegex(t *testing.T) {
|
||||
{
|
||||
log: "2001-01-01T01:01:01.000000Z 0 [Note] [MY-000000] [Galera] (90002222-1111, 'ssl://0.0.0.0:4567') Found matching local endpoint for a connection, blacklisting address ssl://127.0.0.1:4567",
|
||||
expected: regexTestState{
|
||||
Ctx: types.LogCtx{OwnIPs: []string{"127.0.0.1"}},
|
||||
LogCtx: types.LogCtx{OwnIPs: []string{"127.0.0.1"}},
|
||||
},
|
||||
expectedOut: "127.0.0.1 is local",
|
||||
key: "RegexSourceNode",
|
||||
@@ -20,7 +20,7 @@ func TestIdentsRegex(t *testing.T) {
|
||||
{
|
||||
log: "2001-01-01T01:01:01.000000Z 0 [Note] [MY-000000] [Galera] Passing config to GCS: base_dir = /var/lib/mysql/; base_host = 127.0.0.1; base_port = 4567; cert.log_conflicts = no; cert.optimistic_pa = no; debug = no; evs.auto_evict = 0; evs.delay_margin = PT1S; evs.delayed_keep_period = PT30S; evs.inactive_check_period = PT0.5S; evs.inactive_timeout = PT15S; evs.join_retrans_period = PT1S; evs.max_install_timeouts = 3; evs.send_window = 10; evs.stats_report_period = PT1M; evs.suspect_timeout = PT5S; evs.user_send_window = 4; evs.view_forget_timeout = PT24H; gcache.dir = /data/mysql/; gcache.freeze_purge_at_seqno = -1; gcache.keep_pages_count = 0; gcache.keep_pages_size = 0; gcache.mem_size = 0; gcache.name = galera.cache; gcache.page_size = 128M; gcache.recover = yes; gcache.size = 128M; gcomm.thread_prio = ; gcs.fc_debug = 0; gcs.fc_factor = 1.0; gcs.fc_limit = 100; gcs.fc_master_slave = no; gcs.max_packet_size = 64500; gcs.max_throttle = 0.25; gcs.recv_q_hard_limit = 9223372036854775807; gcs.recv_q_soft_limit = 0.25; gcs.sync_donor = no; gmcast.segment = 0; gmcast.version = 0; pc.announce_timeout = PT3S; pc.checksum = false; pc.ignore_quorum = false; pc.ignore_sb = false; pc.npvo = false; pc.recovery = true; pc.version = 0; pc.wait_prim = true; pc.wait_prim_timeout = PT30S; pc.weight = 1; protonet.backend = asio; protonet.version = 0; repl.causal_read_timeout = PT30S; repl.commit_order = 3; repl.key_format = FLAT8; repl.max_ws_size = 2147483647; repl.proto_max = 10; socket.checksum = 2; socket.recv_buf_size = auto; socket.send_buf_size = auto; socket.ssl_ca = ca.pem; socket.ssl_cert = server-cert.pem; socket.ssl_cipher = ; socket.ssl_compression = YES; socket.ssl_key = server-key.pem;",
|
||||
expected: regexTestState{
|
||||
Ctx: types.LogCtx{OwnIPs: []string{"127.0.0.1"}},
|
||||
LogCtx: types.LogCtx{OwnIPs: []string{"127.0.0.1"}},
|
||||
},
|
||||
expectedOut: "127.0.0.1 is local",
|
||||
key: "RegexBaseHost",
|
||||
@@ -29,7 +29,7 @@ func TestIdentsRegex(t *testing.T) {
|
||||
{
|
||||
log: " 0: 015702fc-32f5-11ed-a4ca-267f97316394, node1",
|
||||
input: regexTestState{
|
||||
Ctx: types.LogCtx{
|
||||
LogCtx: types.LogCtx{
|
||||
MyIdx: "0",
|
||||
MemberCount: 1,
|
||||
OwnHashes: []string{},
|
||||
@@ -39,7 +39,7 @@ func TestIdentsRegex(t *testing.T) {
|
||||
State: "PRIMARY",
|
||||
},
|
||||
expected: regexTestState{
|
||||
Ctx: types.LogCtx{
|
||||
LogCtx: types.LogCtx{
|
||||
MyIdx: "0",
|
||||
MemberCount: 1,
|
||||
OwnHashes: []string{"015702fc-a4ca"},
|
||||
@@ -54,7 +54,7 @@ func TestIdentsRegex(t *testing.T) {
|
||||
{
|
||||
log: " 0: 015702fc-32f5-11ed-a4ca-267f97316394, node1",
|
||||
input: regexTestState{
|
||||
Ctx: types.LogCtx{
|
||||
LogCtx: types.LogCtx{
|
||||
MyIdx: "0",
|
||||
MemberCount: 1,
|
||||
OwnHashes: []string{},
|
||||
@@ -64,7 +64,7 @@ func TestIdentsRegex(t *testing.T) {
|
||||
State: "NON-PRIMARY",
|
||||
},
|
||||
expected: regexTestState{
|
||||
Ctx: types.LogCtx{
|
||||
LogCtx: types.LogCtx{
|
||||
MyIdx: "0",
|
||||
MemberCount: 1,
|
||||
OwnHashes: []string{"015702fc-a4ca"},
|
||||
@@ -79,7 +79,7 @@ func TestIdentsRegex(t *testing.T) {
|
||||
{
|
||||
log: " 0: 015702fc-32f5-11ed-a4ca-267f97316394, node1",
|
||||
input: regexTestState{
|
||||
Ctx: types.LogCtx{
|
||||
LogCtx: types.LogCtx{
|
||||
MyIdx: "0",
|
||||
MemberCount: 2,
|
||||
},
|
||||
@@ -87,7 +87,7 @@ func TestIdentsRegex(t *testing.T) {
|
||||
State: "NON-PRIMARY",
|
||||
},
|
||||
expected: regexTestState{
|
||||
Ctx: types.LogCtx{
|
||||
LogCtx: types.LogCtx{
|
||||
MyIdx: "0",
|
||||
MemberCount: 2,
|
||||
},
|
||||
@@ -100,7 +100,7 @@ func TestIdentsRegex(t *testing.T) {
|
||||
{
|
||||
log: " 1: 015702fc-32f5-11ed-a4ca-267f97316394, node1",
|
||||
input: regexTestState{
|
||||
Ctx: types.LogCtx{
|
||||
LogCtx: types.LogCtx{
|
||||
MyIdx: "1",
|
||||
MemberCount: 1,
|
||||
OwnHashes: []string{},
|
||||
@@ -110,7 +110,7 @@ func TestIdentsRegex(t *testing.T) {
|
||||
State: "PRIMARY",
|
||||
},
|
||||
expected: regexTestState{
|
||||
Ctx: types.LogCtx{
|
||||
LogCtx: types.LogCtx{
|
||||
MyIdx: "1",
|
||||
MemberCount: 1,
|
||||
OwnHashes: []string{"015702fc-a4ca"},
|
||||
@@ -125,7 +125,7 @@ func TestIdentsRegex(t *testing.T) {
|
||||
{
|
||||
log: " 0: 015702fc-32f5-11ed-a4ca-267f97316394, node1",
|
||||
input: regexTestState{
|
||||
Ctx: types.LogCtx{
|
||||
LogCtx: types.LogCtx{
|
||||
MyIdx: "1",
|
||||
MemberCount: 1,
|
||||
},
|
||||
@@ -133,7 +133,7 @@ func TestIdentsRegex(t *testing.T) {
|
||||
State: "PRIMARY",
|
||||
},
|
||||
expected: regexTestState{
|
||||
Ctx: types.LogCtx{
|
||||
LogCtx: types.LogCtx{
|
||||
MyIdx: "1",
|
||||
MemberCount: 1,
|
||||
},
|
||||
@@ -146,7 +146,7 @@ func TestIdentsRegex(t *testing.T) {
|
||||
{
|
||||
log: " 0: 015702fc-32f5-11ed-a4ca-267f97316394, node1.with.complete.fqdn",
|
||||
input: regexTestState{
|
||||
Ctx: types.LogCtx{
|
||||
LogCtx: types.LogCtx{
|
||||
MyIdx: "1",
|
||||
MemberCount: 1,
|
||||
},
|
||||
@@ -154,7 +154,7 @@ func TestIdentsRegex(t *testing.T) {
|
||||
State: "PRIMARY",
|
||||
},
|
||||
expected: regexTestState{
|
||||
Ctx: types.LogCtx{
|
||||
LogCtx: types.LogCtx{
|
||||
MyIdx: "1",
|
||||
MemberCount: 1,
|
||||
},
|
||||
@@ -168,14 +168,14 @@ func TestIdentsRegex(t *testing.T) {
|
||||
name: "name too long and truncated",
|
||||
log: " 0: 015702fc-32f5-11ed-a4ca-267f97316394, name_so_long_it_will_get_trunca",
|
||||
input: regexTestState{
|
||||
Ctx: types.LogCtx{
|
||||
LogCtx: types.LogCtx{
|
||||
MyIdx: "1",
|
||||
MemberCount: 1,
|
||||
},
|
||||
State: "PRIMARY",
|
||||
},
|
||||
expected: regexTestState{
|
||||
Ctx: types.LogCtx{
|
||||
LogCtx: types.LogCtx{
|
||||
MyIdx: "1",
|
||||
MemberCount: 1,
|
||||
},
|
||||
@@ -190,7 +190,7 @@ func TestIdentsRegex(t *testing.T) {
|
||||
log: " members(1):",
|
||||
expectedOut: "view member count: 1",
|
||||
expected: regexTestState{
|
||||
Ctx: types.LogCtx{MemberCount: 1},
|
||||
LogCtx: types.LogCtx{MemberCount: 1},
|
||||
},
|
||||
key: "RegexMemberCount",
|
||||
},
|
||||
@@ -198,10 +198,10 @@ func TestIdentsRegex(t *testing.T) {
|
||||
{
|
||||
log: "2001-01-01T01:01:01.000000Z 1 [Note] [MY-000000] [Galera] ####### My UUID: 60205de0-5cf6-11ec-8884-3a01908be11a",
|
||||
input: regexTestState{
|
||||
Ctx: types.LogCtx{},
|
||||
LogCtx: types.LogCtx{},
|
||||
},
|
||||
expected: regexTestState{
|
||||
Ctx: types.LogCtx{
|
||||
LogCtx: types.LogCtx{
|
||||
OwnHashes: []string{"60205de0-8884"},
|
||||
},
|
||||
},
|
||||
@@ -212,10 +212,10 @@ func TestIdentsRegex(t *testing.T) {
|
||||
{
|
||||
log: "2001-01-01T01:01:01.000000Z 0 [Note] WSREP: (9509c194, 'tcp://0.0.0.0:4567') turning message relay requesting on, nonlive peers:",
|
||||
input: regexTestState{
|
||||
Ctx: types.LogCtx{},
|
||||
LogCtx: types.LogCtx{},
|
||||
},
|
||||
expected: regexTestState{
|
||||
Ctx: types.LogCtx{
|
||||
LogCtx: types.LogCtx{
|
||||
OwnHashes: []string{"9509c194"},
|
||||
},
|
||||
},
|
||||
@@ -226,10 +226,10 @@ func TestIdentsRegex(t *testing.T) {
|
||||
{
|
||||
log: "2001-01-01T01:01:01.000000Z 0 [Note] WSREP: New COMPONENT: primary = yes, bootstrap = no, my_idx = 0, memb_num = 2",
|
||||
input: regexTestState{
|
||||
Ctx: types.LogCtx{},
|
||||
LogCtx: types.LogCtx{},
|
||||
},
|
||||
expected: regexTestState{
|
||||
Ctx: types.LogCtx{
|
||||
LogCtx: types.LogCtx{
|
||||
MyIdx: "0",
|
||||
},
|
||||
},
|
||||
@@ -240,10 +240,10 @@ func TestIdentsRegex(t *testing.T) {
|
||||
{
|
||||
log: "2001-01-01T01:01:01.000000Z 0 [Note] WSREP: (9509c194, 'tcp://0.0.0.0:4567') connection established to 838ebd6d tcp://172.17.0.2:4567",
|
||||
input: regexTestState{
|
||||
Ctx: types.LogCtx{},
|
||||
LogCtx: types.LogCtx{},
|
||||
},
|
||||
expected: regexTestState{
|
||||
Ctx: types.LogCtx{
|
||||
LogCtx: types.LogCtx{
|
||||
OwnHashes: []string{"9509c194"},
|
||||
},
|
||||
},
|
||||
@@ -254,10 +254,10 @@ func TestIdentsRegex(t *testing.T) {
|
||||
{
|
||||
log: " own_index: 1",
|
||||
input: regexTestState{
|
||||
Ctx: types.LogCtx{},
|
||||
LogCtx: types.LogCtx{},
|
||||
},
|
||||
expected: regexTestState{
|
||||
Ctx: types.LogCtx{
|
||||
LogCtx: types.LogCtx{
|
||||
MyIdx: "1",
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user