Skip to content

Commit

Permalink
Removed unused funcs
Browse files Browse the repository at this point in the history
Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>
  • Loading branch information
naveensrinivasan committed Dec 15, 2022
1 parent 21aa3bb commit a18abc8
Showing 1 changed file with 3 additions and 31 deletions.
34 changes: 3 additions & 31 deletions pkg/util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
// limitations under the License.

//go:build e2e
// +build e2e

package util

Expand All @@ -38,10 +37,9 @@ import (
)

var (
cli = "rekor-cli"
server = "rekor-server"
nodeDataDir = "node"
keys openpgp.EntityList
cli = "rekor-cli"
server = "rekor-server"
keys openpgp.EntityList
)

type GetOut struct {
Expand Down Expand Up @@ -310,24 +308,6 @@ func RunCli(t *testing.T, arg ...string) string {
return Run(t, "", cli, arg...)
}

func RunCliStdout(t *testing.T, arg ...string) string {
t.Helper()
arg = append([]string{coverageFlag()}, arg...)
arg = append(arg, rekorServerFlag())
c := exec.Command(cli, arg...)

if os.Getenv("REKORTMPDIR") != "" {
// ensure that we use a clean state.json file for each Run
c.Env = append(c.Env, "HOME="+os.Getenv("REKORTMPDIR"))
}
b, err := c.Output()
if err != nil {
t.Log(string(b))
t.Fatal(err)
}
return stripCoverageOutput(string(b))
}

func RunCliErr(t *testing.T, arg ...string) string {
t.Helper()
arg = append([]string{coverageFlag()}, arg...)
Expand Down Expand Up @@ -364,14 +344,6 @@ func stripCoverageOutput(out string) string {
return strings.Split(strings.Split(out, "PASS")[0], "FAIL")[0]
}

func readFile(t *testing.T, p string) string {
b, err := ioutil.ReadFile(p)
if err != nil {
t.Fatal(err)
}
return strings.TrimSpace(string(b))
}

// RandomSuffix returns a random string of the given length.
func RandomSuffix(n int) string {
const letterBytes = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
Expand Down

0 comments on commit a18abc8

Please sign in to comment.