Closed andreeaflorescu closed 6 years ago
One way to do this is to have the Microvm class generate a new unique mac for each network interface that is created, and have the SSH use that (it would probably mean moving making the SSH a capability of the Microvm class.
For the future.
Addressed by #391 The IP & MAC of microvms are unique accross a test run session.
We currently have only one microvm image with the ssh capability. Since this is the case, we were able to set the IP dynamically from the MAC address.
For microvm ubuntu_with_ssh, the IP is set at boot time from the mac address. For the IP, the last 4 bytes of the mac address are used as follow: 06:00:C0:A8:F1:02 -> remove first 2 bytes -> C0:A8:F1:02 -> hex to decimal -> 192:168:241:2 -> replace : with . -> 192.168.241.2
This work was needed because tests are run in parallel so we need a mechanism to insure that all microvms have different IPs. Otherwise, we end up with many microvms having the same IP.
This problem appears again when we have more than one microvm-image with the ssh capability. The same test can be run with 2 microvm-images in parallel thus we will have the same IP for both images.
One way to solve this would be to have a singleton class that assigns MAC addresses and makes sure that its unique across a testrun session. A test with the ssh fixture would then request an unique mac address.