2024-04-29 21:29:05 +02:00
|
|
|
package pkg
|
2023-02-26 16:07:14 +01:00
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
)
|
|
|
|
|
2024-04-29 21:50:16 +02:00
|
|
|
const (
|
2023-02-26 16:07:14 +01:00
|
|
|
binaryPath = "/bin/bash"
|
2024-04-29 21:50:16 +02:00
|
|
|
scriptPath = "testdata/test-script.sh"
|
2023-02-26 16:07:14 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestDeploy(t *testing.T) {
|
|
|
|
err := Deploy(binaryPath, scriptPath)
|
|
|
|
require.NoError(t, err)
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestDeployError(t *testing.T) {
|
|
|
|
err := Deploy("", "")
|
|
|
|
require.Error(t, err)
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestExecute(t *testing.T) {
|
|
|
|
err := execute(binaryPath, scriptPath)
|
|
|
|
require.NoError(t, err)
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestExecuteError(t *testing.T) {
|
|
|
|
err := execute("", "")
|
|
|
|
require.Error(t, err)
|
|
|
|
}
|