Skip to content

Commit fbcfabe

Browse files
authored
Merge pull request kubernetes#83808 from oomichi/rename-volume-fixtures
Rename Generate[Read|Write]FileCmd()s on e2e framework
2 parents 5e26508 + e13fb0c commit fbcfabe

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

test/e2e/framework/volume/fixtures.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ func testVolumeContent(client clientset.Interface, pod *v1.Pod, fsGroup *int64,
523523
if test.Mode == v1.PersistentVolumeBlock {
524524
// Block: check content
525525
deviceName := fmt.Sprintf("/opt/%d", i)
526-
commands := GenerateReadBlockCmd(deviceName, len(test.ExpectedContent))
526+
commands := generateReadBlockCmd(deviceName, len(test.ExpectedContent))
527527
_, err := framework.LookForStringInPodExec(pod.Namespace, pod.Name, commands, test.ExpectedContent, time.Minute)
528528
framework.ExpectNoError(err, "failed: finding the contents of the block device %s.", deviceName)
529529

@@ -532,7 +532,7 @@ func testVolumeContent(client clientset.Interface, pod *v1.Pod, fsGroup *int64,
532532
} else {
533533
// Filesystem: check content
534534
fileName := fmt.Sprintf("/opt/%d/%s", i, test.File)
535-
commands := GenerateReadFileCmd(fileName)
535+
commands := generateReadFileCmd(fileName)
536536
_, err := framework.LookForStringInPodExec(pod.Namespace, pod.Name, commands, test.ExpectedContent, time.Minute)
537537
framework.ExpectNoError(err, "failed: finding the contents of the mounted file %s.", fileName)
538538

@@ -593,12 +593,12 @@ func InjectContent(client clientset.Interface, config TestConfig, fsGroup *int64
593593
if test.Mode == v1.PersistentVolumeBlock {
594594
// Block: write content
595595
deviceName := fmt.Sprintf("/opt/%d", i)
596-
commands = append(commands, GenerateWriteBlockCmd(test.ExpectedContent, deviceName)...)
596+
commands = append(commands, generateWriteBlockCmd(test.ExpectedContent, deviceName)...)
597597

598598
} else {
599599
// Filesystem: write content
600600
fileName := fmt.Sprintf("/opt/%d/%s", i, test.File)
601-
commands = append(commands, GenerateWriteFileCmd(test.ExpectedContent, fileName)...)
601+
commands = append(commands, generateWriteFileCmd(test.ExpectedContent, fileName)...)
602602
}
603603
out, err := framework.RunKubectl(commands...)
604604
framework.ExpectNoError(err, "failed: writing the contents: %s", out)
@@ -634,9 +634,9 @@ func GenerateScriptCmd(command string) []string {
634634
return commands
635635
}
636636

637-
// GenerateWriteBlockCmd generates the corresponding command lines to write to a block device the given content.
637+
// generateWriteBlockCmd generates the corresponding command lines to write to a block device the given content.
638638
// Depending on the Node OS is Windows or linux, the command will use powershell or /bin/sh
639-
func GenerateWriteBlockCmd(content, fullPath string) []string {
639+
func generateWriteBlockCmd(content, fullPath string) []string {
640640
var commands []string
641641
if !framework.NodeOSDistroIs("windows") {
642642
commands = []string{"/bin/sh", "-c", "echo '" + content + "' > " + fullPath}
@@ -646,9 +646,9 @@ func GenerateWriteBlockCmd(content, fullPath string) []string {
646646
return commands
647647
}
648648

649-
// GenerateWriteFileCmd generates the corresponding command lines to write a file with the given content and file path.
649+
// generateWriteFileCmd generates the corresponding command lines to write a file with the given content and file path.
650650
// Depending on the Node OS is Windows or linux, the command will use powershell or /bin/sh
651-
func GenerateWriteFileCmd(content, fullPath string) []string {
651+
func generateWriteFileCmd(content, fullPath string) []string {
652652
var commands []string
653653
if !framework.NodeOSDistroIs("windows") {
654654
commands = []string{"/bin/sh", "-c", "echo '" + content + "' > " + fullPath}
@@ -658,9 +658,9 @@ func GenerateWriteFileCmd(content, fullPath string) []string {
658658
return commands
659659
}
660660

661-
// GenerateReadFileCmd generates the corresponding command lines to read from a file with the given file path.
661+
// generateReadFileCmd generates the corresponding command lines to read from a file with the given file path.
662662
// Depending on the Node OS is Windows or linux, the command will use powershell or /bin/sh
663-
func GenerateReadFileCmd(fullPath string) []string {
663+
func generateReadFileCmd(fullPath string) []string {
664664
var commands []string
665665
if !framework.NodeOSDistroIs("windows") {
666666
commands = []string{"cat", fullPath}
@@ -670,9 +670,9 @@ func GenerateReadFileCmd(fullPath string) []string {
670670
return commands
671671
}
672672

673-
// GenerateReadBlockCmd generates the corresponding command lines to read from a block device with the given file path.
673+
// generateReadBlockCmd generates the corresponding command lines to read from a block device with the given file path.
674674
// Depending on the Node OS is Windows or linux, the command will use powershell or /bin/sh
675-
func GenerateReadBlockCmd(fullPath string, numberOfCharacters int) []string {
675+
func generateReadBlockCmd(fullPath string, numberOfCharacters int) []string {
676676
var commands []string
677677
if !framework.NodeOSDistroIs("windows") {
678678
commands = []string{"head", "-c", strconv.Itoa(numberOfCharacters), fullPath}

0 commit comments

Comments
 (0)