NFVBENCH-196: New NFVbench image for generator part (nfvbench and TRex codes inside VM)
[nfvbench.git] / nfvbenchvm / dib / elements / nfvbenchvm / static / etc / rc.d / rc.local.loopvm
@@ -2,7 +2,7 @@
 
 touch /var/lock/subsys/local
 
-# Waiting for cloud-init to generate $TESTPMD_CONF, retry 60 seconds
+# Waiting for cloud-init to generate $NFVBENCH_CONF, retry 60 seconds
 NFVBENCH_CONF=/etc/nfvbenchvm.conf
 retry=30
 until [ $retry -eq 0 ]; do
@@ -175,8 +175,8 @@ if [ $PCI_ADDRESS_1 ] && [ $PCI_ADDRESS_2 ]; then
     if [ "$FORWARDER" == "testpmd" ]; then
         echo "Configuring testpmd..."
         # Binding ports to DPDK
-        /dpdk/dpdk-devbind.py -b igb_uio $PCI_ADDRESS_1
-        /dpdk/dpdk-devbind.py -b igb_uio $PCI_ADDRESS_2
+        dpdk-devbind -b igb_uio $PCI_ADDRESS_1
+        dpdk-devbind -b igb_uio $PCI_ADDRESS_2
         screen -dmSL testpmd /dpdk/testpmd \
                             -c $CORE_MASK \
                             -n 4 \
@@ -195,7 +195,7 @@ if [ $PCI_ADDRESS_1 ] && [ $PCI_ADDRESS_2 ]; then
                                 --cmdline-file=/dpdk/testpmd_cmd.txt
         echo "testpmd running in screen 'testpmd'"
         logger "NFVBENCHVM: testpmd running in screen 'testpmd'"
-    else
+    elif [ "$FORWARDER" == "vpp" ]; then
         echo "Configuring vpp..."
         cp /vpp/startup.conf /etc/vpp/startup.conf
         cp /vpp/vm.conf /etc/vpp/vm.conf
@@ -233,6 +233,9 @@ if [ $PCI_ADDRESS_1 ] && [ $PCI_ADDRESS_2 ]; then
         sed -i "s/{{TG_GATEWAY2_IP}}/${TG_GATEWAY2_IP}/g" /etc/vpp/vm.conf
         service vpp restart
         logger "NFVBENCHVM: vpp service restarted"
+    else
+        echo "ERROR: Unknown forwarder value. Accepted values: testpmd or vpp"
+        exit 1
     fi
 else
     echo "ERROR: Cannot find PCI Address from MAC"
@@ -241,9 +244,4 @@ else
     logger "NFVBENCHVM ERROR: Cannot find PCI Address from MAC"
 fi
 
-# Set SSH config
-logger $(cat /etc/ssh/sshd_config | grep "PasswordAuthentication")
-sed -i 's/PasswordAuthentication no/#PasswordAuthentication no/g' /etc/ssh/sshd_config
-sed -i 's/#PasswordAuthentication yes/PasswordAuthentication yes/g' /etc/ssh/sshd_config
-logger $(cat /etc/ssh/sshd_config | grep "PasswordAuthentication")
-service sshd restart
+exit 0
\ No newline at end of file