mirror of
https://github.com/luscis/openlan.git
synced 2025-10-07 01:22:51 +08:00
fix: yum install failed for centos like.
This commit is contained in:
2
dist/resource/point.cfg
vendored
2
dist/resource/point.cfg
vendored
@@ -1,4 +1,4 @@
|
|||||||
# --- point.cfg ---
|
# --- point.cfg ---
|
||||||
# This file define the configuration for OpenLAN Point.
|
# This file define the configuration for OpenLAN Point.
|
||||||
|
|
||||||
OPTIONS='-log:file /dev/null -terminal off -cacert /etc/openlan/ca-trusted.crt'
|
OPTIONS='-log:file /dev/null -terminal off'
|
||||||
|
11
dist/script/install.sh
vendored
11
dist/script/install.sh
vendored
@@ -12,11 +12,12 @@ function download() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function requires() {
|
function requires() {
|
||||||
local os=$(cat /etc/os-release | grep ^ID= | sed 's/"//g')
|
if type yum > /dev/null; then
|
||||||
if echo $os | grep -q -e centos -e redhat; then
|
yum install -y net-tools iptables iputils openvpn openvswitch dnsmasq
|
||||||
yum install -y net-tools iptables iputils openvpn openssl11 openvswitch dnsmasq
|
elif type apt > /dev/null; then
|
||||||
elif echo $os | grep -q -e debian -e ubuntu; then
|
apt-get install -y net-tools iptables iproute2 openvpn openvswitch-switch dnsmasq
|
||||||
apt-get install -y net-tools iptables iproute2 openvpn openssl openvswitch-switch dnsmasq
|
else
|
||||||
|
echo "We didn't find yum and apt."
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
18
pkg/cache/store_test.go
vendored
18
pkg/cache/store_test.go
vendored
@@ -27,32 +27,32 @@ func TestInit(t *testing.T) {
|
|||||||
UUID: "fake",
|
UUID: "fake",
|
||||||
Client: &SocketClientMock{},
|
Client: &SocketClientMock{},
|
||||||
})
|
})
|
||||||
assert.Equal(t, 1 , Point.Clients.Len(), "MUST be same")
|
assert.Equal(t, 1, Point.Clients.Len(), "MUST be same")
|
||||||
EspState.Add(&models.EspState{
|
EspState.Add(&models.EspState{
|
||||||
EspState: &schema.EspState {},
|
EspState: &schema.EspState{},
|
||||||
})
|
})
|
||||||
assert.Equal(t, 1 , EspState.State.Len(), "MUST be same")
|
assert.Equal(t, 1, EspState.State.Len(), "MUST be same")
|
||||||
User.Add(&models.User{
|
User.Add(&models.User{
|
||||||
Alias: "fake",
|
Alias: "fake",
|
||||||
})
|
})
|
||||||
assert.Equal(t, 1 , User.Users.Len(), "MUST be same")
|
assert.Equal(t, 1, User.Users.Len(), "MUST be same")
|
||||||
Link.Add("fake-uuid", &models.Link{
|
Link.Add("fake-uuid", &models.Link{
|
||||||
User: "fake",
|
User: "fake",
|
||||||
})
|
})
|
||||||
assert.Equal(t, 1 , Link.Links.Len(), "MUST be same")
|
assert.Equal(t, 1, Link.Links.Len(), "MUST be same")
|
||||||
EspPolicy.Add(&models.EspPolicy{
|
EspPolicy.Add(&models.EspPolicy{
|
||||||
EspPolicy: &schema.EspPolicy{},
|
EspPolicy: &schema.EspPolicy{},
|
||||||
})
|
})
|
||||||
assert.Equal(t, 1 , EspPolicy.Policy.Len(), "MUST be same")
|
assert.Equal(t, 1, EspPolicy.Policy.Len(), "MUST be same")
|
||||||
Online.Add(&models.Line{
|
Online.Add(&models.Line{
|
||||||
EthType: 0,
|
EthType: 0,
|
||||||
})
|
})
|
||||||
assert.Equal(t, 1 , Online.Lines.Len(), "MUST be same")
|
assert.Equal(t, 1, Online.Lines.Len(), "MUST be same")
|
||||||
Neighbor.Add(&models.Neighbor{
|
Neighbor.Add(&models.Neighbor{
|
||||||
Network: "fake",
|
Network: "fake",
|
||||||
})
|
})
|
||||||
assert.Equal(t, 1 , Neighbor.Neighbors.Len(), "MUST be same")
|
assert.Equal(t, 1, Neighbor.Neighbors.Len(), "MUST be same")
|
||||||
Reload()
|
Reload()
|
||||||
assert.Equal(t, 0, EspState.State.Len(), "MUST be same")
|
assert.Equal(t, 0, EspState.State.Len(), "MUST be same")
|
||||||
assert.Equal(t, 0 , EspPolicy.Policy.Len(), "MUST be same")
|
assert.Equal(t, 0, EspPolicy.Policy.Len(), "MUST be same")
|
||||||
}
|
}
|
@@ -17,7 +17,7 @@ func TestESPSpecifies(t *testing.T) {
|
|||||||
Peer: "1.1.1.0",
|
Peer: "1.1.1.0",
|
||||||
Address: "1.1.1.1",
|
Address: "1.1.1.1",
|
||||||
Spi: 0x01,
|
Spi: 0x01,
|
||||||
State:EspState{
|
State: EspState{
|
||||||
Remote: "3.3.3.3",
|
Remote: "3.3.3.3",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -41,7 +41,7 @@ func TestESPSpecifies_GetMember(t *testing.T) {
|
|||||||
Peer: "1.1.1.0",
|
Peer: "1.1.1.0",
|
||||||
Address: "1.1.1.1",
|
Address: "1.1.1.1",
|
||||||
Spi: 123,
|
Spi: 123,
|
||||||
State:EspState{
|
State: EspState{
|
||||||
Remote: "3.3.3.3",
|
Remote: "3.3.3.3",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -56,7 +56,7 @@ func TestESPSpecifies_GetMember(t *testing.T) {
|
|||||||
Peer: "1.1.1.0",
|
Peer: "1.1.1.0",
|
||||||
Address: "1.1.1.2",
|
Address: "1.1.1.2",
|
||||||
Spi: 124,
|
Spi: 124,
|
||||||
State:EspState{
|
State: EspState{
|
||||||
Remote: "3.3.3.4",
|
Remote: "3.3.3.4",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -82,7 +82,7 @@ func TestESPSpecifies_AddPolicy(t *testing.T) {
|
|||||||
Peer: "1.1.1.0",
|
Peer: "1.1.1.0",
|
||||||
Address: "1.1.1.2",
|
Address: "1.1.1.2",
|
||||||
Spi: 124,
|
Spi: 124,
|
||||||
State:EspState{
|
State: EspState{
|
||||||
Local: "3.3.3.1",
|
Local: "3.3.3.1",
|
||||||
Remote: "3.3.3.3",
|
Remote: "3.3.3.3",
|
||||||
},
|
},
|
||||||
|
@@ -16,7 +16,7 @@ func TestNewProxy(t *testing.T) {
|
|||||||
},
|
},
|
||||||
Tcp: []*TcpProxy{
|
Tcp: []*TcpProxy{
|
||||||
{
|
{
|
||||||
Listen:"0.0.0.0:22",
|
Listen: "0.0.0.0:22",
|
||||||
Target: []string{
|
Target: []string{
|
||||||
"1.1.1.1:23",
|
"1.1.1.1:23",
|
||||||
"1.1.1.2:34",
|
"1.1.1.2:34",
|
||||||
|
@@ -9,8 +9,10 @@ import (
|
|||||||
|
|
||||||
func TestSwitch_LoadPass(t *testing.T) {
|
func TestSwitch_LoadPass(t *testing.T) {
|
||||||
sw := &Switch{}
|
sw := &Switch{}
|
||||||
sw.LoadPass("../../.password.no")
|
cache.User.SetFile("../../.password.no")
|
||||||
sw.LoadPass("../../packaging/resource/password.example")
|
sw.LoadPass()
|
||||||
|
cache.User.SetFile("../../packaging/resource/password.example")
|
||||||
|
sw.LoadPass()
|
||||||
for user := range cache.User.List() {
|
for user := range cache.User.List() {
|
||||||
if user == nil {
|
if user == nil {
|
||||||
break
|
break
|
||||||
|
Reference in New Issue
Block a user