Utility to clean known_hosts
- utility to clean known_hosts when identities of nodes defined in the cell changed
Change-Id: Iab818ca9d888cfb58c98f16f62174cc75a4f32b7
diff --git a/tools/test/bin/onos-remove-cell-sshkeys b/tools/test/bin/onos-remove-cell-sshkeys
new file mode 100755
index 0000000..3c7b70c
--- /dev/null
+++ b/tools/test/bin/onos-remove-cell-sshkeys
@@ -0,0 +1,9 @@
+#!/bin/bash
+# -----------------------------------------------------------------------------
+# Removes known_host entries about current ONOS cell.
+# -----------------------------------------------------------------------------
+
+for host in $OCT $OCN $(env | egrep "^OC[0-9]+" | cut -d '=' -f 2); do
+ ssh-keygen -F "$host" >/dev/null && ssh-keygen -R "$host"
+ ssh-keygen -F "[$host]:8101" >/dev/null && ssh-keygen -R "[$host]:8101"
+done
diff --git a/tools/test/bin/onos-verify-cell b/tools/test/bin/onos-verify-cell
index 7361616..8999ad4 100755
--- a/tools/test/bin/onos-verify-cell
+++ b/tools/test/bin/onos-verify-cell
@@ -7,5 +7,5 @@
. $ONOS_ROOT/tools/build/envDefaults
for node in $OCT $OCN $(env | sort | egrep "^OC[0-9]+" | cut -d= -f2); do
- printf "%s: " $node; ssh -n -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o PasswordAuthentication=no $ONOS_USER@$node hostname
+ printf "%s: " $node; ssh -n -q -o StrictHostKeyChecking=no -o PasswordAuthentication=no $ONOS_USER@$node hostname
done