#!/bin/sh

set -e

PID_FILE="nield.pid"
LOG_FILE="nield.log"

cd $AUTOPKGTEST_TMP

nield -4 -p $PID_FILE -l $LOG_FILE

ip link add dummy0 type dummy
ip link delete dummy0

kill $(cat $PID_FILE)

cat $LOG_FILE | grep "interface added"
cat $LOG_FILE | grep "interface deleted"
cat $LOG_FILE | grep $(cat $PID_FILE | grep -o "[0-9]*")
