Skip to content
This repository has been archived by the owner on Sep 24, 2021. It is now read-only.

Commit

Permalink
enable e2e test for port mapping
Browse files Browse the repository at this point in the history
Signed-off-by: heartlock <[email protected]>
  • Loading branch information
heartlock committed Jun 8, 2017
1 parent fd4a194 commit 12875ef
Showing 1 changed file with 30 additions and 18 deletions.
48 changes: 30 additions & 18 deletions hack/test-e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -88,32 +88,44 @@ function install_remote_hyperd() {
function configure_cni() {
# install cni
sudo mkdir -p /etc/cni/net.d /opt/cni/bin
curl -sSL https://github.com/containernetworking/cni/releases/download/${CNI_VERSION}/cni-amd64-${CNI_VERSION}.tgz -o cni.tgz
sudo tar zxvf cni.tgz -C /opt/cni/bin
rm -f cni.tgz

git clone https://github.com/containernetworking/plugins $GOPATH/src/github.com/containernetworking/plugins
cd $GOPATH/src/github.com/containernetworking/plugins

./build.sh
sudo cp bin/* /opt/cni/bin/

# create network configure file
sudo sh -c 'cat >/etc/cni/net.d/10-mynet.conf <<-EOF
sudo sh -c 'cat >/etc/cni/net.d/10-mynet.conflist <<-EOF
{
"cniVersion": "0.3.0",
"cniVersion": "0.3.1",
"name": "mynet",
"type": "bridge",
"bridge": "cni0",
"isGateway": true,
"ipMasq": true,
"ipam": {
"type": "host-local",
"subnet": "10.30.0.0/16",
"routes": [
{ "dst": "0.0.0.0/0" }
]
}
"plugins": [
{
"type": "bridge",
"bridge": "cni0",
"isGateway": true,
"ipMasq": true,
"ipam": {
"type": "host-local",
"subnet": "10.30.0.0/16",
"routes": [
{ "dst": "0.0.0.0/0" }
]
}
},
{
"type": "portmap",
"capabilities": {"portMappings": true},
"snat": false
}
]
}
EOF'

sudo sh -c 'cat >/etc/cni/net.d/99-loopback.conf <<-EOF
{
"cniVersion": "0.3.0",
"cniVersion": "0.3.1",
"type": "loopback"
}
EOF'
Expand All @@ -124,7 +136,7 @@ function test_cri() {
go get github.com/kubernetes-incubator/cri-tools/cmd/critest

# run critest
sudo env PATH=$PATH:$GOPATH/bin GOPATH=$GOPATH critest -r=/var/run/frakti.sock --focus="Conformance" --skip="container port" validation
sudo env PATH=$PATH:$GOPATH/bin GOPATH=$GOPATH critest -r=/var/run/frakti.sock --focus="Conformance" validation
}

FRAKTI_LISTEN_ADDR=${FRAKTI_LISTEN_ADDR:-/var/run/frakti.sock}
Expand Down

0 comments on commit 12875ef

Please sign in to comment.