lol

nixosTests.google-oslogin: fix tests, provide group mock endpoint

If our (fake) metadata server provides a 404 instead of a JSON document,
the NSS module segfaults, and as we do NSS lookups through ns(n)cd,
not only crashes the application doing the NSS lookup, but our ns(n)cd.

This has been causing segfaults of nscd all along, but since our switch
from glibc-nscd to nsncd, caused the test to fail entirely.

In any case, by handling /computeMetadata/v1/oslogin/groups we get the
NSS lookup to not cause any segfaults, and to succeed the test again.

+10
+10
nixos/tests/google-oslogin/server.py
··· 103 103 self._send_json_ok(gen_mockuser(username=username, uid=uid, gid=uid, home_directory=f"/home/{username}", snakeoil_pubkey=SNAKEOIL_PUBLIC_KEY)) 104 104 return 105 105 106 + # we need to provide something at the groups endpoint. 107 + # the nss module does segfault if we don't. 108 + elif pu.path == "/computeMetadata/v1/oslogin/groups": 109 + self._send_json_ok({ 110 + "posixGroups": [ 111 + {"name" : "demo", "gid" : 4294967295} 112 + ], 113 + }) 114 + return 115 + 106 116 # authorize endpoint 107 117 elif pu.path == "/computeMetadata/v1/oslogin/authorize": 108 118 # is user allowed to login?