The guest image tools do not properly configure a network interface
in the image for layer2. When hipersockets is used, setting the MAC
fails with "Operation not supported". No communication with the
dhcp on the network is possible.
OSA was not affected as layer2 is the default for OSA if nothing is
provided (for hipersockets it's layer3).
Change-Id: I203a8d4e62afb10666e9b131164e77ab4f85d890
Closes-Bug: #1685737
Sometimes the autoconfigure_networking.service fails with the following
errors:
/lib/s390-tools/lsznet.raw: line 187: cannot create temp file for
here-document: Permission denied
lsznet.raw: ERROR: sysfs reported 0 CHPIDs instead of expected 8
/sbin/znetconf: line 1302: cannot create temp file for here-document:
Read-only file system
znetconf: Error: No configuration found for device ID 0.0.0004
This happens as the service started too early, even before the local
filesystem is available. Changing the systemd startup order to
start the service after the file system target is reached solves
the issue.
Change-Id: I90fd98ee225405d8d9d60b466a46efaa1aa6b6d8
Closes-Bug: #1670349
The error occures if the directory '/sys/bus/ccwgroup/' does not
exist (znetconf is checking for that). This directory gets created
when the 'ccwgroup' kernel module is initialized. Therefore the
solution is to ensure that this kernel module is loaded.
Change-Id: Ifc8917b702f7a8913c5662fcbb9f15c1248ed55d
Closes-Bug: #1666524
Adding Testcases for the functions used by guest-image-tools. The
tests are executed by python and integrated into the py27 and py35
test jobs.
Sometimes the guest image tools call external commands
(like ip, zneconf,...). for this case dummy versions of those
executeables are placed in a faked root directory. The test takes
care of exectuing those commands in this directory, therefore the
dummy (bash) executables are chosen over the real ones.
However those dummy executeables cannot replace mocks where a lot
of assertions can be done. As workaround the dummy executeable just
check if it was called with a certain list of arguments. The test
needs to exactly pass those arguments in order to succeed.
Ideally those tests would be functional tests running on a real
system z envrionement. Doing so we could verify if the real
operations are working as well.
Change-Id: I35d0840c2e4bb9d216d57a5927f20b3f0ff182c0
Moving all bash functions into a separate file. This avoids that the
main script gets executed when testing function, as now just this
new function file get be sourced.
Change-Id: Ia9219080790d92f671618ba4aef90e2b6bab78b3
This is required in order to move those functions into a separate
file. This file can than be easily used for testing.
Change-Id: Ib3c7a2cc0625ecda51f21a52d374bd7c7e340dbd
Since some of the functions are getting called in subshells. Calling
exit in a subshell just quits the subshell but not the whole
programm. As some of the functions should lead to a programm
termination, a fix is required.
Setting "set -e" ensures that the whole programm is being exited in
such cases.
Change-Id: I3269534029e40109e7cec580a83a27f489acbe17
The guest image tools must be installed inside an operating system
to allow automated network configuration.
* autoconfigure_networking
A systemd service that starts before cloud-init. It groups qeth
devices to network interfaces that can be consumed by Linux.
Therefore all devices listed in /proc/cmdline get configured with
the provided portno in layer2 mode. The format of the data in the
cmdline must be
<devno>,<portno>[,<mac>];
* Setmac
A udev rule and the corresponding script to change the MAC address
of a network interface from within the guests operating system.
This is done along the data provided via /proc/cmdline. The format
of the data in the cmdline must be
<devno>,<portno>,<mac>;
Note: The boot-os-specific-parameters property of a partition is used
to pass in data from Nova into the operation system. This data is
appended to /proc/cmdline.
Change-Id: Iea199b085aca34769128a8691e95e790a396ee80