Skip to content

Commit

Permalink
tests: Enable macvlan and ipvlan tests
Browse files Browse the repository at this point in the history
Now that macvlan and ipvlan has been merged
kata-containers/runtime#852 and
kata-containers/runtime#506, we
can enable the test to run in our CI.

Fixes kata-containers#899

Signed-off-by: Gabriela Cervantes <[email protected]>
  • Loading branch information
GabyCT committed Nov 9, 2018
1 parent ccaee02 commit ff3d476
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
TIMEOUT := 60

# union for 'make test'
UNION := functional docker crio docker-compose netmon docker-stability openshift kubernetes swarm vm-factory entropy ramdisk
UNION := functional docker crio docker-compose network netmon docker-stability openshift kubernetes swarm vm-factory entropy ramdisk

# skipped test suites for docker integration tests
SKIP :=
Expand Down Expand Up @@ -93,6 +93,7 @@ vm-factory:


network:
systemctl is-active --quiet docker || sudo systemctl start docker
bash -f .ci/install_bats.sh
bats integration/network/macvlan/macvlan_driver.bats
bats integration/network/ipvlan/ipvlan_driver.bats
Expand Down
11 changes: 6 additions & 5 deletions integration/network/ipvlan/ipvlan_driver.bats
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,15 @@ setup() {

# Run the first container
docker run -d --runtime=kata-runtime --network=${NETWORK_NAME} --ip=${FIRST_IP} \
--name=${FIRST_CONTAINER_NAME} --runtime=runc ${IMAGE} sh -c ${PAYLOAD}
--name=${FIRST_CONTAINER_NAME} --runtime=runc ${IMAGE} ${PAYLOAD}

# Run the second container
docker run -d --runtime=kata-runtime --network=${NETWORK_NAME} --ip=${SECOND_IP} \
--name=${SECOND_CONTAINER_NAME} --runtime=runc ${IMAGE} sh -c ${PAYLOAD}
--name=${SECOND_CONTAINER_NAME} --runtime=runc ${IMAGE} ${PAYLOAD}

# Ping to the first container
run docker exec ${SECOND_CONTAINER_NAME} sh -c "ping -c ${PACKET_NUMBER} ${FIRST_IP}"
echo "$status"
[ "$status" -eq 0 ]
}

Expand All @@ -81,11 +82,11 @@ setup() {

# Run the first container
docker run -d --runtime=kata-runtime --network=${NETWORK_NAME} --ip=${FIRST_IP} \
--name=${FIRST_CONTAINER_NAME} --runtime=runc ${IMAGE} sh -c ${PAYLOAD}
--name=${FIRST_CONTAINER_NAME} --runtime=runc ${IMAGE} ${PAYLOAD}

# Run the second container
docker run -d --runtime=kata-runtime --network=${NETWORK_NAME} --ip=${SECOND_IP} \
--name=${SECOND_CONTAINER_NAME} --runtime=runc ${IMAGE} sh -c ${PAYLOAD}
--name=${SECOND_CONTAINER_NAME} --runtime=runc ${IMAGE} ${PAYLOAD}

# Ping to the first container
run docker exec ${SECOND_CONTAINER_NAME} sh -c "ping -c ${PACKET_NUMBER} ${FIRST_IP}"
Expand All @@ -101,7 +102,7 @@ teardown() {
# Remove experimental flag
check_which_flag=$(grep -c -x '{"experimental":true}' $docker_configuration_file)
if [ $check_which_flag -eq 1 ]; then
rm -f $docker_configuration_path
rm -rf $docker_configuration_path
else
sed -i 's|"experimental": true,||' $docker_configuration_file
fi
Expand Down
2 changes: 1 addition & 1 deletion integration/network/macvlan/macvlan_driver.bats
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ setup () {
docker run -d --runtime=${RUNTIME} --network=${NETWORK_NAME} --name=${FIRST_CONTAINER_NAME} ${IMAGE} sh -c "tail -f /dev/null"

# Verify ip address
ip_address=$(docker inspect --format "{{.NetworkSettings.IPAddress}}" ${FIRST_CONTAINER_NAME})
ip_address=$(docker inspect --format "{{.NetworkSettings.Networks.$NETWORK_NAME.IPAddress}}" ${FIRST_CONTAINER_NAME})
if [ -z "$ip_address" ]; then
echo >&2 "ERROR: Container ip address not found"
exit 1
Expand Down

0 comments on commit ff3d476

Please sign in to comment.