Skip to content

Commit

Permalink
mantle/kola: Drop DropLabeledFile()
Browse files Browse the repository at this point in the history
After the last commit there are no users of this.
  • Loading branch information
dustymabe authored and jlebon committed Sep 24, 2024
1 parent b076a72 commit 23cdc20
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions mantle/kola/cluster/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,8 @@ func (t *TestCluster) ListNativeFunctions() []string {
return t.NativeFuncs
}

// DropLabeledFile places file from localPath to ~/ on every machine in
// cluster, potentially with a custom SELinux label.
func DropLabeledFile(machines []platform.Machine, localPath, selabel string) error {
// DropFile places file from localPath to ~/ on every machine in cluster
func DropFile(machines []platform.Machine, localPath string) error {
in, err := os.Open(localPath)
if err != nil {
return err
Expand All @@ -125,23 +124,13 @@ func DropLabeledFile(machines []platform.Machine, localPath, selabel string) err
if err := platform.InstallFile(in, m, partial); err != nil {
return err
}
if selabel != "" {
if out, stderr, err := m.SSH(fmt.Sprintf("sudo chcon -t %s %s.partial", selabel, base)); err != nil {
return errors.Wrapf(err, "running chcon on %s.partial: %s: %s", base, out, stderr)
}
}
if out, stderr, err := m.SSH(fmt.Sprintf("mv %[1]s.partial %[1]s", base)); err != nil {
return errors.Wrapf(err, "running mv %[1]s.partial %[1]s: %s: %s", base, out, stderr)
}
}
return nil
}

// DropFile places file from localPath to ~/ on every machine in cluster
func DropFile(machines []platform.Machine, localPath string) error {
return DropLabeledFile(machines, localPath, "")
}

// SSH runs a ssh command on the given machine in the cluster. It differs from
// Machine.SSH in that stderr is written to the test's output as a 'Log' line.
// This ensures the output will be correctly accumulated under the correct
Expand Down

0 comments on commit 23cdc20

Please sign in to comment.