Loading
nixos/test-driver: stop blackholing `vde_switch` stderr
The code seems to have been ported from the old Perl code. It worked, but had some smells: 1. It swallowed all `stderr` into a pipe we never read. In addition to making things difficult to debug, it could potentially result in `vde_switch` hanging if it gets blocked trying to write to a pipe that's full. Solution: just let `vde_switch` inherit our `stderr`. 2. If `vde_switch` failed to start, we just logged a warning and continued on. Now we crash. 3. We allocated a PTY to communicate with `vde_switch`'s management REPL. This was unnecessary: non-TTY stdin/stdout works fine. 4. There was an old TODO here about not blocking forever trying to read `vde_switch`'s stdout. I've addressed that by using `select` with a timeout. NOTE: this does change the API surface area of the `VLan` class a bit: there's no longer a `fd` attribute that points at a PTY master. I did an unscientific grep through `nixos/tests` and couldn't find references to `vlan[0-9].fd` nor `vlans[...].fd`.