This commit is contained in:
admju
2024-09-04 07:11:13 +00:00
parent d12d3e31bf
commit 48301bf82e
17 changed files with 210 additions and 25 deletions

View File

@@ -0,0 +1,22 @@
package kubectl
import (
"os"
"path/filepath"
"testing"
"github.com/stretchr/testify/assert"
)
func TestKubectlVersion(t *testing.T){
bin := filepath.Join(TEST_BIN_DIR, "kubectl")
os.Chmod(bin, 0700)
assert.FileExists(t, bin, "TestKubectlVersion error")
version, err := Version(bin)
assert.Nilf(t, err, "error message %s", bin)
assert.Equal(t, "v1.30.3", version, "TestKubectlVersion error")
}