Skip to contentSkip to conversation

tests/vm: Clean out old working directories on build

PATCH In review Peter Maydell 2 participants 3 messages Aug 20, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tests/vm: Clean out old working directories on build

When we do a build inside one of the BSD VMs, first delete any stale old build directories from the VM's /var/tmp. This prevents the VM from running out of disk space after it has been used for a dozen or so builds.

---
The Ubuntu test VM has a similar issue, but it doesn't put its test build directories in /var/tmp/ like the BSDs, and I don't use it so I'm not sure what the right rm command would be. Somebody else can fix it if they care...

Disclaimer: not actually tested yet, but obviously it will get tested as part of applying it to master, which I'd like to do so my pullrequest tests don't keep getting tripped up by this bug.

 tests/vm/freebsd | 1 +
 tests/vm/netbsd  | 1 +
 tests/vm/openbsd | 1 +
 3 files changed, 3 insertions(+)
tests/vm/freebsd +1 -0
index 0a6ec4614a7..b6983127d09 100755
@@ -20,6 +20,7 @@ class FreeBSDVM(basevm.BaseVM):
     name = "freebsd"
     BUILD_SCRIPT = """
         set -e;
+        rm -rf /var/tmp/qemu-test.*
         cd $(mktemp -d /var/tmp/qemu-test.XXXXXX);
         tar -xf /dev/vtbd1;
         ./configure {configure_opts};
tests/vm/netbsd +1 -0
index 45c9260dc0d..a4e25820d50 100755
@@ -20,6 +20,7 @@ class NetBSDVM(basevm.BaseVM):
     name = "netbsd"
     BUILD_SCRIPT = """
         set -e;
+        rm -rf /var/tmp/qemu-test.*
         cd $(mktemp -d /var/tmp/qemu-test.XXXXXX);
         tar -xf /dev/rld1a;
         ./configure --python=python2.7 {configure_opts};
tests/vm/openbsd +1 -0
index 98edfbca4ba..52500ee52bb 100755
@@ -20,6 +20,7 @@ class OpenBSDVM(basevm.BaseVM):
     name = "openbsd"
     BUILD_SCRIPT = """
         set -e;
+        rm -rf /var/tmp/qemu-test.*
         cd $(mktemp -d /var/tmp/qemu-test.XXXXXX);
         tar -xf /dev/rsd1c;
         ./configure --cc=x86_64-unknown-openbsd6.1-gcc-4.9.4 --python=python2.7 {configure_opts};
Signature · 1 line
2.18.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 13 lines · Peter Maydell

When we do a build inside one of the BSD VMs, first delete any stale old build directories from the VM's /var/tmp. This prevents the VM from running out of disk space after it has been used for a dozen or so builds.

---
The Ubuntu test VM has a similar issue, but it doesn't put its test build directories in /var/tmp/ like the BSDs, and I don't use it so I'm not sure what the right rm command would be. Somebody else can fix it if they care...

Quoted 4 lines

Disclaimer: not actually tested yet, but obviously it will get tested as part of applying it to master, which I'd like to do so my pullrequest tests don't keep getting tripped up by this bug.

Please merge this yourself if it helps your pull request handling workflow.

Quoted 46 lines
 tests/vm/freebsd | 1 +
 tests/vm/netbsd  | 1 +
 tests/vm/openbsd | 1 +
 3 files changed, 3 insertions(+)
tests/vm/freebsd +1 -0
index 0a6ec4614a7..b6983127d09 100755
@@ -20,6 +20,7 @@ class FreeBSDVM(basevm.BaseVM):
     name = "freebsd"
     BUILD_SCRIPT = """
         set -e;
+        rm -rf /var/tmp/qemu-test.*
         cd $(mktemp -d /var/tmp/qemu-test.XXXXXX);
         tar -xf /dev/vtbd1;
         ./configure {configure_opts};
tests/vm/netbsd +1 -0
index 45c9260dc0d..a4e25820d50 100755
@@ -20,6 +20,7 @@ class NetBSDVM(basevm.BaseVM):
     name = "netbsd"
     BUILD_SCRIPT = """
         set -e;
+        rm -rf /var/tmp/qemu-test.*
         cd $(mktemp -d /var/tmp/qemu-test.XXXXXX);
         tar -xf /dev/rld1a;
         ./configure --python=python2.7 {configure_opts};
tests/vm/openbsd +1 -0
index 98edfbca4ba..52500ee52bb 100755
@@ -20,6 +20,7 @@ class OpenBSDVM(basevm.BaseVM):
     name = "openbsd"
     BUILD_SCRIPT = """
         set -e;
+        rm -rf /var/tmp/qemu-test.*
         cd $(mktemp -d /var/tmp/qemu-test.XXXXXX);
         tar -xf /dev/rsd1c;
         ./configure --cc=x86_64-unknown-openbsd6.1-gcc-4.9.4 --python=python2.7 {configure_opts};
Signature · 1 line
2.18.0
#2 lore raw
Quoted 14 lines · Fam Zheng
Quoted 13 lines · Peter Maydell

When we do a build inside one of the BSD VMs, first delete any stale old build directories from the VM's /var/tmp. This prevents the VM from running out of disk space after it has been used for a dozen or so builds.

---
The Ubuntu test VM has a similar issue, but it doesn't put its test build directories in /var/tmp/ like the BSDs, and I don't use it so I'm not sure what the right rm command would be. Somebody else can fix it if they care...

Quoted 8 lines
Quoted 4 lines

Disclaimer: not actually tested yet, but obviously it will get tested as part of applying it to master, which I'd like to do so my pullrequest tests don't keep getting tripped up by this bug.

Please merge this yourself if it helps your pull request handling workflow.

Thanks; I've applied it to master. We can probably come up with a cleaner approach with disk snapshots, but this will suffice to avoid build failures in the meantime.

-- PMM