mirror of https://github.com/apache/jclouds.git
issue 384: arp bug fixed
This commit is contained in:
parent
b4e4c26f44
commit
5d102ea0bb
|
@ -226,8 +226,8 @@ public class VirtualboxLiveTest {
|
||||||
|
|
||||||
mutable.getNetworkAdapter(new Long(0)).setAttachmentType(NetworkAttachmentType.Bridged);
|
mutable.getNetworkAdapter(new Long(0)).setAttachmentType(NetworkAttachmentType.Bridged);
|
||||||
mutable.getNetworkAdapter(new Long(0)).setAdapterType(NetworkAdapterType.Am79C973);
|
mutable.getNetworkAdapter(new Long(0)).setAdapterType(NetworkAdapterType.Am79C973);
|
||||||
mutable.getNetworkAdapter(new Long(0)).setMACAddress(manager.getVBox().getHost().generateMACAddress());
|
mutable.getNetworkAdapter(new Long(0)).setMACAddress("0800279DA478");
|
||||||
mutable.getNetworkAdapter(new Long(0)).setBridgedInterface(hostInterface.trim());
|
mutable.getNetworkAdapter(new Long(0)).setBridgedInterface("virbr0");
|
||||||
mutable.getNetworkAdapter(new Long(0)).setEnabled(true);
|
mutable.getNetworkAdapter(new Long(0)).setEnabled(true);
|
||||||
mutable.saveSettings();
|
mutable.saveSettings();
|
||||||
session.unlockMachine();
|
session.unlockMachine();
|
||||||
|
@ -244,21 +244,21 @@ public class VirtualboxLiveTest {
|
||||||
offset++;
|
offset++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
String simplifiedMacAddressOfClonedVM = macAddressOfClonedVM;
|
String simplifiedMacAddressOfClonedVM = macAddressOfClonedVM;
|
||||||
|
|
||||||
|
/*
|
||||||
if(simplifiedMacAddressOfClonedVM.contains("00"))
|
if(simplifiedMacAddressOfClonedVM.contains("00"))
|
||||||
simplifiedMacAddressOfClonedVM = new StringBuffer(simplifiedMacAddressOfClonedVM).delete(simplifiedMacAddressOfClonedVM.indexOf("00"), simplifiedMacAddressOfClonedVM.indexOf("00") + 1).toString();
|
simplifiedMacAddressOfClonedVM = new StringBuffer(simplifiedMacAddressOfClonedVM).delete(simplifiedMacAddressOfClonedVM.indexOf("00"), simplifiedMacAddressOfClonedVM.indexOf("00") + 1).toString();
|
||||||
|
|
||||||
if(simplifiedMacAddressOfClonedVM.contains("0"))
|
if(simplifiedMacAddressOfClonedVM.contains("0"))
|
||||||
if(simplifiedMacAddressOfClonedVM.indexOf("0") + 1 != ':' && simplifiedMacAddressOfClonedVM.indexOf("0") - 1 != ':')
|
if(simplifiedMacAddressOfClonedVM.indexOf("0") + 1 != ':' && simplifiedMacAddressOfClonedVM.indexOf("0") - 1 != ':')
|
||||||
simplifiedMacAddressOfClonedVM = new StringBuffer(simplifiedMacAddressOfClonedVM).delete(simplifiedMacAddressOfClonedVM.indexOf("0"), simplifiedMacAddressOfClonedVM.indexOf("0") + 1).toString();
|
simplifiedMacAddressOfClonedVM = new StringBuffer(simplifiedMacAddressOfClonedVM).delete(simplifiedMacAddressOfClonedVM.indexOf("0"), simplifiedMacAddressOfClonedVM.indexOf("0") + 1).toString();
|
||||||
|
*/
|
||||||
|
runScriptOnNode(hostId, "for i in $(seq 1 254) ; do ping -c 1 -t 1 192.168.122.$i & done", runAsRoot(false).wrapInInitScript(false));
|
||||||
|
|
||||||
|
String arpLine = runScriptOnNode(hostId, "arp -an | grep " + simplifiedMacAddressOfClonedVM, runAsRoot(false).wrapInInitScript(false)).getOutput();
|
||||||
|
String ipAddress = arpLine.substring(arpLine.indexOf("(") + 1, arpLine.indexOf(")"));
|
||||||
|
|
||||||
//runScriptOnNode(hostId, "ping 192.168.1.255", runAsRoot(false).wrapInInitScript(false));
|
|
||||||
|
|
||||||
String ipAddress = runScriptOnNode(hostId, "arp -an | grep " + simplifiedMacAddressOfClonedVM, runAsRoot(false).wrapInInitScript(false)).getOutput();
|
|
||||||
//
|
|
||||||
System.out.println("IP address " + ipAddress);
|
System.out.println("IP address " + ipAddress);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -271,11 +271,9 @@ public class VirtualboxLiveTest {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
System.out.println(ipAddress + " is the IP address of " + clonedVM.getName());
|
|
||||||
|
|
||||||
//TODO
|
//TODO
|
||||||
// IPSocket socket = new IPSocket(ipAddress, 22);
|
IPSocket socket = new IPSocket(ipAddress, 22);
|
||||||
// checkSSH(IPSocket socket)
|
checkSSH(socket);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue