mirror of
https://github.com/empayre/fleet.git
synced 2024-11-07 09:18:59 +00:00
f4d3159cc9
* WIP * WIP2 * Fix orbit and fleetctl tests * Amend macos-app default * Add some fixes * Use fleetctl updates roots command * Add more fixes to Updater * Fixes to app publishing and downloading * Add more changes to support fleetctl cross generation * Amend comment * Add pkg generation to ease testing * Make more fixes * Add changes entry * Add legacy targets (until our TUF system exposes the new app) * Fix fleetctl preview * Fix bool flag * Fix orbit logic for disabled-updates and dev-mode * Fix TestPreview * Remove constant and fix zip-slip attack (codeql) * Return unknown error * Fix updater's checkExec * Add support for executable signing in init_tuf.sh * Try only signing orbit * Fix init_tuf.sh targets, macos-app only for osqueryd * Specify GOARCH to support M1s * Add workflow to generate osqueryd.app.tar.gz * Use 5.2.2 on init_tuf.sh * Add unit test for tar.gz target * Use artifacts instead of releases * Remove copy paste residue * Trigger workflow on PR * Fixes to ease handling of artifact * Fix, do not use target name as dir * Remove workaround
63 lines
853 B
Go
63 lines
853 B
Go
package process
|
|
|
|
import (
|
|
"os"
|
|
|
|
"github.com/stretchr/testify/mock"
|
|
)
|
|
|
|
type mockOsProcess struct {
|
|
mock.Mock
|
|
OsProcess
|
|
}
|
|
|
|
func (m *mockOsProcess) Signal(sig os.Signal) error {
|
|
args := m.Called(sig)
|
|
err := args.Error(0)
|
|
if err == nil {
|
|
return nil
|
|
}
|
|
return err
|
|
}
|
|
|
|
func (m *mockOsProcess) Kill() error {
|
|
args := m.Called()
|
|
err := args.Error(0)
|
|
if err == nil {
|
|
return nil
|
|
}
|
|
return err
|
|
}
|
|
|
|
type mockExecCmd struct {
|
|
mock.Mock
|
|
ExecCmd
|
|
}
|
|
|
|
func (m *mockExecCmd) Start() error {
|
|
args := m.Called()
|
|
err := args.Error(0)
|
|
if err == nil {
|
|
return nil
|
|
}
|
|
return err
|
|
}
|
|
|
|
func (m *mockExecCmd) Wait() error {
|
|
args := m.Called()
|
|
err := args.Error(0)
|
|
if err == nil {
|
|
return nil
|
|
}
|
|
return err
|
|
}
|
|
|
|
func (m *mockExecCmd) OsProcess() OsProcess {
|
|
args := m.Called()
|
|
proc := args.Get(0)
|
|
if proc == nil {
|
|
return nil
|
|
}
|
|
return proc.(OsProcess)
|
|
}
|