Benchmarking for wwctl overlay build

- Benchmarks overlay build in an environment with 1000 nodes
- Updates testenv to support both benchmarks and tests

To execute:

```
go test github.com/warewulf/warewulf/internal/app/wwctl/overlay/build -bench Benchmark_Overlay_Build
```

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
This commit is contained in:
Jonathon Anderson
2024-12-23 18:17:57 -07:00
parent 276e67fc54
commit a18913924d
55 changed files with 3361 additions and 245 deletions

View File

@@ -32,14 +32,14 @@ func Test_ImportContainerDir(t *testing.T) {
for name, tt := range tests {
t.Run(name, func(t *testing.T) {
env := testenv.New(t)
defer env.RemoveAll(t)
defer env.RemoveAll()
src := "/tmp/testcontainer"
env.CreateFile(t, filepath.Join(src, "/bin/sh"))
env.CreateFile(filepath.Join(src, "/bin/sh"))
for _, file := range tt.files {
env.CreateFile(t, filepath.Join(src, file))
env.CreateFile(filepath.Join(src, file))
}
for _, socket := range tt.sockets {
env.MkdirAll(t, filepath.Dir(filepath.Join(src, socket)))
env.MkdirAll(filepath.Dir(filepath.Join(src, socket)))
assert.NoError(t, unix.Mknod(env.GetPath(filepath.Join(src, socket)), unix.S_IFSOCK|0777, 0))
}
assert.NoError(t, ImportDirectory(env.GetPath(src), "testcontainer"))