Skip to content
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

sabakan-cryptsetup: enable no_read_workqueue and no_write_workqueue #230

Merged
merged 1 commit into from
Jan 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mtest/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ PLACEMAT = /usr/bin/placemat2
GINKGO = $(GOPATH)/bin/ginkgo
ETCD_VERSION = 3.5.1
PLACEMAT_DATADIR = /var/scratch/placemat
COREOS_VERSION := 2765.2.1
COREOS_VERSION := 3033.2.0
COREOS_KERNEL := $(abspath .)/flatcar_production_pxe.vmlinuz
COREOS_INITRD := $(abspath .)/flatcar_production_pxe_image.cpio.gz
CT_VERSION = 0.6.1
Expand Down
26 changes: 26 additions & 0 deletions mtest/netboot_test.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
package mtest

import (
"bufio"
"bytes"
"encoding/json"
"errors"
"fmt"
"io"
"os"
"path/filepath"
"strings"
"time"

. "github.com/onsi/ginkgo"
Expand Down Expand Up @@ -65,6 +68,29 @@ func testNetboot() {
if err != nil {
return fmt.Errorf("%v: stderr=%s", err, stderr)
}
stdout, stderr, err = execAt(worker, "sudo", "dmsetup", "table", "/dev/mapper/crypt-*")
if err != nil {
return fmt.Errorf("%v: stderr=%s", err, stderr)
}
scanner := bufio.NewScanner(bytes.NewReader(stdout))
for scanner.Scan() {
hasNoReadWorkQueue := false
hasNoWriteWorkQueue := false
for _, field := range strings.Fields(scanner.Text()) {
if field == "no_read_workqueue" {
hasNoReadWorkQueue = true
}
if field == "no_write_workqueue" {
hasNoWriteWorkQueue = true
}
}
if !hasNoReadWorkQueue || !hasNoWriteWorkQueue {
return fmt.Errorf("no_read_workqueue or no_write_workqueue is not set: %s", scanner.Text())
}
}
if err = scanner.Err(); err != nil {
return fmt.Errorf("reading stdout: %w", err)
}
return nil
}, 6*time.Minute).Should(Succeed())
}
Expand Down
1 change: 1 addition & 0 deletions pkg/sabakan-cryptsetup/cmd/cryptsetup.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ func Cryptsetup(d Disk, md *Metadata, ek, tpmKek []byte) error {
// https://gitlab.com/cryptsetup/cryptsetup/wikis/DMCrypt
//"--sector-size=" + strconv.Itoa(d.SectorSize()),
"--allow-discards",
"--perf-no_read_workqueue", "--perf-no_write_workqueue",
"open", "--type=plain", d.Device(), d.CryptName(),
}
cmd := exec.Command(cryptsetupCmd, args...)
Expand Down