We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 369b261 commit f78b96fCopy full SHA for f78b96f
test/util/util.go
@@ -4,6 +4,8 @@ import (
4
"fmt"
5
"strings"
6
"time"
7
+
8
+ "github.com/gotestyourself/gotestyourself/icmd"
9
)
10
11
// WaitTimeout wait at most timeout nanoseconds,
@@ -54,3 +56,13 @@ func TrimAllSpaceAndNewline(input string) string {
54
56
55
57
return output
58
}
59
60
+// Get major:minor device number
61
+func getMajMinNumOfDevice(device string) (string, bool) {
62
+ cmd := fmt.Sprintf("lsblk -d -o MAJ:MIN %s | sed /MAJ:MIN/d | awk '{print $1}'", device)
63
+ number := icmd.RunCommand("bash", "-c", cmd).Stdout()
64
+ if number != "" {
65
+ return strings.Trim(number, "\n"), true
66
+ }
67
+ return "", false
68
+}
0 commit comments