"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "pkg/config/server_test.go" between
frp-0.36.1.tar.gz and frp-0.36.2.tar.gz

About: frp is a fast reverse proxy to help you expose a local server behind a NAT or firewall to the Internet. As of now, it supports TCP and UDP, as well as HTTP and HTTPS protocols, and it also has a P2P connect mode.

server_test.go  (frp-0.36.1):server_test.go  (frp-0.36.2)
skipping to change at line 21 skipping to change at line 21
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
package config package config
import ( import (
"testing" "testing"
"github.com/fatedier/frp/pkg/auth" "github.com/fatedier/frp/pkg/auth"
"github.com/fatedier/frp/pkg/plugin/server" plugin "github.com/fatedier/frp/pkg/plugin/server"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
) )
func Test_LoadServerCommonConf(t *testing.T) { func Test_LoadServerCommonConf(t *testing.T) {
assert := assert.New(t) assert := assert.New(t)
testcases := []struct { testcases := []struct {
source []byte source []byte
expected ServerCommonConf expected ServerCommonConf
skipping to change at line 136 skipping to change at line 136
HeartbeatTimeout: 99, HeartbeatTimeout: 99,
UserConnTimeout: 9, UserConnTimeout: 9,
AllowPorts: map[int]struct{}{ AllowPorts: map[int]struct{}{
10: struct{}{}, 10: struct{}{},
11: struct{}{}, 11: struct{}{},
12: struct{}{}, 12: struct{}{},
99: struct{}{}, 99: struct{}{},
}, },
MaxPoolCount: 59, MaxPoolCount: 59,
MaxPortsPerClient: 9, MaxPortsPerClient: 9,
TLSOnly: false, TLSOnly: true,
TLSCertFile: "server.crt", TLSCertFile: "server.crt",
TLSKeyFile: "server.key", TLSKeyFile: "server.key",
TLSTrustedCaFile: "ca.crt", TLSTrustedCaFile: "ca.crt",
SubDomainHost: "frps.com", SubDomainHost: "frps.com",
TCPMux: true, TCPMux: true,
UDPPacketSize: 1509, UDPPacketSize: 1509,
HTTPPlugins: map[string]plugin.HTTPPluginOptions{ HTTPPlugins: map[string]plugin.HTTPPluginOptions{
"user-manager": { "user-manager": {
Name: "user-manager", Name: "user-manager",
skipping to change at line 180 skipping to change at line 180
ServerConfig: auth.ServerConfig{ ServerConfig: auth.ServerConfig{
BaseConfig: auth.BaseConfig{ BaseConfig: auth.BaseConfig{
AuthenticationMethod: "token" , AuthenticationMethod: "token" ,
AuthenticateHeartBeats: false, AuthenticateHeartBeats: false,
AuthenticateNewWorkConns: false, AuthenticateNewWorkConns: false,
}, },
}, },
BindAddr: "0.0.0.9", BindAddr: "0.0.0.9",
BindPort: 7009, BindPort: 7009,
BindUDPPort: 7008, BindUDPPort: 7008,
ProxyBindAddr: "0.0.0.0", ProxyBindAddr: "0.0.0.9",
VhostHTTPTimeout: 60, VhostHTTPTimeout: 60,
DashboardAddr: "0.0.0.0", DashboardAddr: "0.0.0.0",
DashboardUser: "admin", DashboardUser: "admin",
DashboardPwd: "admin", DashboardPwd: "admin",
EnablePrometheus: false, EnablePrometheus: false,
LogFile: "console", LogFile: "console",
LogWay: "console", LogWay: "console",
LogLevel: "info", LogLevel: "info",
LogMaxDays: 3, LogMaxDays: 3,
DetailedErrorsToClient: true, DetailedErrorsToClient: true,
skipping to change at line 205 skipping to change at line 205
UserConnTimeout: 10, UserConnTimeout: 10,
HTTPPlugins: make(map[string]plugin.HT TPPluginOptions), HTTPPlugins: make(map[string]plugin.HT TPPluginOptions),
UDPPacketSize: 1500, UDPPacketSize: 1500,
}, },
}, },
} }
for _, c := range testcases { for _, c := range testcases {
actual, err := UnmarshalServerConfFromIni(c.source) actual, err := UnmarshalServerConfFromIni(c.source)
assert.NoError(err) assert.NoError(err)
actual.Complete()
assert.Equal(c.expected, actual) assert.Equal(c.expected, actual)
} }
} }
 End of changes. 4 change blocks. 
3 lines changed or deleted 4 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)