New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test-driver.py: don't leave vde1.ctl around #83598
Conversation
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/i-cant-figure-out-how-to-use-a-nix-file-from-a-module/6452/3 |
Creating these in a new tempdir sounds like a better idea - with this PR we still can't run multiple tests interactively, and if the process terminates ungracefully, we might still not clean up properly. If we create these in a temporary directory, we don't need to care ;-)
|
9e3f084
to
c22b2c1
Compare
Updated to use tempdir, PTAL. There's extra directory level because vde changes the permissions to 777 which feels wrong in /tmp (but probably doesn't matter). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you update nixos/lib/qemu-flags.nix:12 to set the permissions of the vde socket, so we can get rid of the directory? There's a mode=octalmode
parameter:
nixos/lib/test-driver/test-driver.py
Outdated
try: | ||
shutil.rmtree(os.path.dirname(socket)) | ||
except Exception as e: | ||
log.log("rmtree error: {}".format(str(e))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
log.log("rmtree error: {}".format(str(e))) | |
log.log("unable to rmtree socket: {}".format(str(e))) |
Send SIGTERM instead of SIGKILL to vde_switch to give it chance to delete the directories.
c22b2c1
to
d4cbe04
Compare
@flokli actually the mode can be set by |
Right, even better. Thanks! |
Motivation for this change
When running tests interactively, VDE control sockets are left on the filesystem, which can prevent nix-build working. Example + reproducer: https://discourse.nixos.org/t/i-cant-figure-out-how-to-use-a-nix-file-from-a-module/6452
Perhaps we can create the sockets in temporary directory to not make the tree unbuildable while the test is running?
cc @tfc