Ubuntu image tests failures
Hey all!
We've had this test suite in our internal pipelines for a while now when building/testing Ubuntu cloud images for GCE. However, there are a few tests that repeatedly fail, and on further inspection I believe they're either false positives or "not applicable" to Ubuntu. What we're doing internally at the moment is skipping these tests (using the `--exclude` flag on `docker run gcr.io/gcp-guest/cloud-image-tests...`) but the issue with this is that it skips the whole suite, which is a shame as there are good tests in these suites that are also being skipped. I've added details below of the failing tests - please let me know if you need any more info.
All the best!
Chlo
* `verifySSHConfig()` fails due to `PermitRootLogin` apparently not being set (`image_security_test.go:133:
"PermitRootLogin" was not set to "no" or "without-password"`). However, in Ubuntu [the
default is `prohibit-password`](https://manpages.ubuntu.com/manpages/focal/en/man5/sshd_config.5.html)?
* `TestHostsFile()` fails due to `/etc/hosts does not contain host record` but I think this test should be skipped for Ubuntu? FWIW here's an example GCE Ubuntu `/etc/hosts` file:
````
ubuntu@kajiya-testing:~$ cat /etc/hosts
127.0.0.1 localhost
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
169.254.169.254 metadata.google.internal metadata
````
* `TestArePackagesLegal()` surfaces a couple of errors: `/usr/share/doc/libcanberra0/copyright`,
`/usr/share/doc/libnspr4/copyright` and `/usr/share/doc/python3-serial/copyright` - we may need to increase the scope of the `var licenses` strings globs?
* `TestGetentPasswdOsloginUser()` and `TestGetentPasswdOsloginUID()` both surface: `getent command failed exit status 2`
while `TestGetentPasswdAllUsers()` returns: `getent passwd output does not contain
sa_105020877179577573373:*:3651018652:3651018652::/home/sa_105020877179577573373` - I'll be honest I'm not sure
why this one is failing at first glace, but FWIW we do test `getent` internally on GCE images :smile: (We verify `"getent passwd
{} | cut -d: -f6".format(user)` for each user in the instance's metadata ssh keys).
* `testShutdownScriptTimeLinux()` returns `shut down time is 89 which is less than 110 seconds` - I understand the sentiment for this test but we also test this internally as well. We run an instance with a `shutdown-script` and check that the correct file was created. However, our internal cutoff time is `30 seconds` instead.
关闭于 2024-01-18 4 条评论