(t *testing.T)
| 30 | ) |
| 31 | |
| 32 | func TestAuthority(t *testing.T) { |
| 33 | tcs := []struct { |
| 34 | name string |
| 35 | useTCP bool |
| 36 | useTLS bool |
| 37 | clientURLPattern string |
| 38 | expectAuthorityPattern string |
| 39 | }{ |
| 40 | { |
| 41 | name: "unix:path", |
| 42 | clientURLPattern: "unix:localhost:${MEMBER_NAME}", |
| 43 | expectAuthorityPattern: "localhost:${MEMBER_NAME}", |
| 44 | }, |
| 45 | { |
| 46 | name: "unix://absolute_path", |
| 47 | clientURLPattern: "unix://localhost:${MEMBER_NAME}", |
| 48 | expectAuthorityPattern: "localhost:${MEMBER_NAME}", |
| 49 | }, |
| 50 | // "unixs" is not standard schema supported by etcd |
| 51 | { |
| 52 | name: "unixs:absolute_path", |
| 53 | useTLS: true, |
| 54 | clientURLPattern: "unixs:localhost:${MEMBER_NAME}", |
| 55 | expectAuthorityPattern: "localhost:${MEMBER_NAME}", |
| 56 | }, |
| 57 | { |
| 58 | name: "unixs://absolute_path", |
| 59 | useTLS: true, |
| 60 | clientURLPattern: "unixs://localhost:${MEMBER_NAME}", |
| 61 | expectAuthorityPattern: "localhost:${MEMBER_NAME}", |
| 62 | }, |
| 63 | { |
| 64 | name: "http://domain[:port]", |
| 65 | useTCP: true, |
| 66 | clientURLPattern: "http://localhost:${MEMBER_PORT}", |
| 67 | expectAuthorityPattern: "localhost:${MEMBER_PORT}", |
| 68 | }, |
| 69 | { |
| 70 | name: "https://domain[:port]", |
| 71 | useTLS: true, |
| 72 | useTCP: true, |
| 73 | clientURLPattern: "https://localhost:${MEMBER_PORT}", |
| 74 | expectAuthorityPattern: "localhost:${MEMBER_PORT}", |
| 75 | }, |
| 76 | { |
| 77 | name: "http://address[:port]", |
| 78 | useTCP: true, |
| 79 | clientURLPattern: "http://127.0.0.1:${MEMBER_PORT}", |
| 80 | expectAuthorityPattern: "127.0.0.1:${MEMBER_PORT}", |
| 81 | }, |
| 82 | { |
| 83 | name: "https://address[:port]", |
| 84 | useTCP: true, |
| 85 | useTLS: true, |
| 86 | clientURLPattern: "https://127.0.0.1:${MEMBER_PORT}", |
| 87 | expectAuthorityPattern: "127.0.0.1:${MEMBER_PORT}", |
| 88 | }, |
| 89 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…