33 lines
		
	
	
		
			526 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			33 lines
		
	
	
		
			526 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| package pkg
 | |
| 
 | |
| import (
 | |
| 	"testing"
 | |
| 
 | |
| 	"github.com/stretchr/testify/require"
 | |
| )
 | |
| 
 | |
| const (
 | |
| 	binaryPath = "/bin/bash"
 | |
| 	scriptPath = "testdata/test-script.sh"
 | |
| )
 | |
| 
 | |
| 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)
 | |
| }
 |