// Code generated by counterfeiter. DO NOT EDIT.
package executionfakes

import (
	"sync"

	"github.com/ehsaniara/joblet/internal/joblet/core/execution"
)

type FakeIsolationManager struct {
	CreateBuilderEnvironmentStub        func(string) (*execution.IsolationContext, error)
	createBuilderEnvironmentMutex       sync.RWMutex
	createBuilderEnvironmentArgsForCall []struct {
		arg1 string
	}
	createBuilderEnvironmentReturns struct {
		result1 *execution.IsolationContext
		result2 error
	}
	createBuilderEnvironmentReturnsOnCall map[int]struct {
		result1 *execution.IsolationContext
		result2 error
	}
	CreateGPUDeviceNodesStub        func(string, []int) error
	createGPUDeviceNodesMutex       sync.RWMutex
	createGPUDeviceNodesArgsForCall []struct {
		arg1 string
		arg2 []int
	}
	createGPUDeviceNodesReturns struct {
		result1 error
	}
	createGPUDeviceNodesReturnsOnCall map[int]struct {
		result1 error
	}
	CreateIsolatedEnvironmentStub        func(string) (*execution.IsolationContext, error)
	createIsolatedEnvironmentMutex       sync.RWMutex
	createIsolatedEnvironmentArgsForCall []struct {
		arg1 string
	}
	createIsolatedEnvironmentReturns struct {
		result1 *execution.IsolationContext
		result2 error
	}
	createIsolatedEnvironmentReturnsOnCall map[int]struct {
		result1 *execution.IsolationContext
		result2 error
	}
	DestroyIsolatedEnvironmentStub        func(string) error
	destroyIsolatedEnvironmentMutex       sync.RWMutex
	destroyIsolatedEnvironmentArgsForCall []struct {
		arg1 string
	}
	destroyIsolatedEnvironmentReturns struct {
		result1 error
	}
	destroyIsolatedEnvironmentReturnsOnCall map[int]struct {
		result1 error
	}
	MountCUDALibrariesStub        func(string, string) error
	mountCUDALibrariesMutex       sync.RWMutex
	mountCUDALibrariesArgsForCall []struct {
		arg1 string
		arg2 string
	}
	mountCUDALibrariesReturns struct {
		result1 error
	}
	mountCUDALibrariesReturnsOnCall map[int]struct {
		result1 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeIsolationManager) CreateBuilderEnvironment(arg1 string) (*execution.IsolationContext, error) {
	fake.createBuilderEnvironmentMutex.Lock()
	ret, specificReturn := fake.createBuilderEnvironmentReturnsOnCall[len(fake.createBuilderEnvironmentArgsForCall)]
	fake.createBuilderEnvironmentArgsForCall = append(fake.createBuilderEnvironmentArgsForCall, struct {
		arg1 string
	}{arg1})
	stub := fake.CreateBuilderEnvironmentStub
	fakeReturns := fake.createBuilderEnvironmentReturns
	fake.recordInvocation("CreateBuilderEnvironment", []interface{}{arg1})
	fake.createBuilderEnvironmentMutex.Unlock()
	if stub != nil {
		return stub(arg1)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakeIsolationManager) CreateBuilderEnvironmentCallCount() int {
	fake.createBuilderEnvironmentMutex.RLock()
	defer fake.createBuilderEnvironmentMutex.RUnlock()
	return len(fake.createBuilderEnvironmentArgsForCall)
}

func (fake *FakeIsolationManager) CreateBuilderEnvironmentCalls(stub func(string) (*execution.IsolationContext, error)) {
	fake.createBuilderEnvironmentMutex.Lock()
	defer fake.createBuilderEnvironmentMutex.Unlock()
	fake.CreateBuilderEnvironmentStub = stub
}

func (fake *FakeIsolationManager) CreateBuilderEnvironmentArgsForCall(i int) string {
	fake.createBuilderEnvironmentMutex.RLock()
	defer fake.createBuilderEnvironmentMutex.RUnlock()
	argsForCall := fake.createBuilderEnvironmentArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakeIsolationManager) CreateBuilderEnvironmentReturns(result1 *execution.IsolationContext, result2 error) {
	fake.createBuilderEnvironmentMutex.Lock()
	defer fake.createBuilderEnvironmentMutex.Unlock()
	fake.CreateBuilderEnvironmentStub = nil
	fake.createBuilderEnvironmentReturns = struct {
		result1 *execution.IsolationContext
		result2 error
	}{result1, result2}
}

func (fake *FakeIsolationManager) CreateBuilderEnvironmentReturnsOnCall(i int, result1 *execution.IsolationContext, result2 error) {
	fake.createBuilderEnvironmentMutex.Lock()
	defer fake.createBuilderEnvironmentMutex.Unlock()
	fake.CreateBuilderEnvironmentStub = nil
	if fake.createBuilderEnvironmentReturnsOnCall == nil {
		fake.createBuilderEnvironmentReturnsOnCall = make(map[int]struct {
			result1 *execution.IsolationContext
			result2 error
		})
	}
	fake.createBuilderEnvironmentReturnsOnCall[i] = struct {
		result1 *execution.IsolationContext
		result2 error
	}{result1, result2}
}

func (fake *FakeIsolationManager) CreateGPUDeviceNodes(arg1 string, arg2 []int) error {
	var arg2Copy []int
	if arg2 != nil {
		arg2Copy = make([]int, len(arg2))
		copy(arg2Copy, arg2)
	}
	fake.createGPUDeviceNodesMutex.Lock()
	ret, specificReturn := fake.createGPUDeviceNodesReturnsOnCall[len(fake.createGPUDeviceNodesArgsForCall)]
	fake.createGPUDeviceNodesArgsForCall = append(fake.createGPUDeviceNodesArgsForCall, struct {
		arg1 string
		arg2 []int
	}{arg1, arg2Copy})
	stub := fake.CreateGPUDeviceNodesStub
	fakeReturns := fake.createGPUDeviceNodesReturns
	fake.recordInvocation("CreateGPUDeviceNodes", []interface{}{arg1, arg2Copy})
	fake.createGPUDeviceNodesMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2)
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakeIsolationManager) CreateGPUDeviceNodesCallCount() int {
	fake.createGPUDeviceNodesMutex.RLock()
	defer fake.createGPUDeviceNodesMutex.RUnlock()
	return len(fake.createGPUDeviceNodesArgsForCall)
}

func (fake *FakeIsolationManager) CreateGPUDeviceNodesCalls(stub func(string, []int) error) {
	fake.createGPUDeviceNodesMutex.Lock()
	defer fake.createGPUDeviceNodesMutex.Unlock()
	fake.CreateGPUDeviceNodesStub = stub
}

func (fake *FakeIsolationManager) CreateGPUDeviceNodesArgsForCall(i int) (string, []int) {
	fake.createGPUDeviceNodesMutex.RLock()
	defer fake.createGPUDeviceNodesMutex.RUnlock()
	argsForCall := fake.createGPUDeviceNodesArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2
}

func (fake *FakeIsolationManager) CreateGPUDeviceNodesReturns(result1 error) {
	fake.createGPUDeviceNodesMutex.Lock()
	defer fake.createGPUDeviceNodesMutex.Unlock()
	fake.CreateGPUDeviceNodesStub = nil
	fake.createGPUDeviceNodesReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeIsolationManager) CreateGPUDeviceNodesReturnsOnCall(i int, result1 error) {
	fake.createGPUDeviceNodesMutex.Lock()
	defer fake.createGPUDeviceNodesMutex.Unlock()
	fake.CreateGPUDeviceNodesStub = nil
	if fake.createGPUDeviceNodesReturnsOnCall == nil {
		fake.createGPUDeviceNodesReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.createGPUDeviceNodesReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

func (fake *FakeIsolationManager) CreateIsolatedEnvironment(arg1 string) (*execution.IsolationContext, error) {
	fake.createIsolatedEnvironmentMutex.Lock()
	ret, specificReturn := fake.createIsolatedEnvironmentReturnsOnCall[len(fake.createIsolatedEnvironmentArgsForCall)]
	fake.createIsolatedEnvironmentArgsForCall = append(fake.createIsolatedEnvironmentArgsForCall, struct {
		arg1 string
	}{arg1})
	stub := fake.CreateIsolatedEnvironmentStub
	fakeReturns := fake.createIsolatedEnvironmentReturns
	fake.recordInvocation("CreateIsolatedEnvironment", []interface{}{arg1})
	fake.createIsolatedEnvironmentMutex.Unlock()
	if stub != nil {
		return stub(arg1)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakeIsolationManager) CreateIsolatedEnvironmentCallCount() int {
	fake.createIsolatedEnvironmentMutex.RLock()
	defer fake.createIsolatedEnvironmentMutex.RUnlock()
	return len(fake.createIsolatedEnvironmentArgsForCall)
}

func (fake *FakeIsolationManager) CreateIsolatedEnvironmentCalls(stub func(string) (*execution.IsolationContext, error)) {
	fake.createIsolatedEnvironmentMutex.Lock()
	defer fake.createIsolatedEnvironmentMutex.Unlock()
	fake.CreateIsolatedEnvironmentStub = stub
}

func (fake *FakeIsolationManager) CreateIsolatedEnvironmentArgsForCall(i int) string {
	fake.createIsolatedEnvironmentMutex.RLock()
	defer fake.createIsolatedEnvironmentMutex.RUnlock()
	argsForCall := fake.createIsolatedEnvironmentArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakeIsolationManager) CreateIsolatedEnvironmentReturns(result1 *execution.IsolationContext, result2 error) {
	fake.createIsolatedEnvironmentMutex.Lock()
	defer fake.createIsolatedEnvironmentMutex.Unlock()
	fake.CreateIsolatedEnvironmentStub = nil
	fake.createIsolatedEnvironmentReturns = struct {
		result1 *execution.IsolationContext
		result2 error
	}{result1, result2}
}

func (fake *FakeIsolationManager) CreateIsolatedEnvironmentReturnsOnCall(i int, result1 *execution.IsolationContext, result2 error) {
	fake.createIsolatedEnvironmentMutex.Lock()
	defer fake.createIsolatedEnvironmentMutex.Unlock()
	fake.CreateIsolatedEnvironmentStub = nil
	if fake.createIsolatedEnvironmentReturnsOnCall == nil {
		fake.createIsolatedEnvironmentReturnsOnCall = make(map[int]struct {
			result1 *execution.IsolationContext
			result2 error
		})
	}
	fake.createIsolatedEnvironmentReturnsOnCall[i] = struct {
		result1 *execution.IsolationContext
		result2 error
	}{result1, result2}
}

func (fake *FakeIsolationManager) DestroyIsolatedEnvironment(arg1 string) error {
	fake.destroyIsolatedEnvironmentMutex.Lock()
	ret, specificReturn := fake.destroyIsolatedEnvironmentReturnsOnCall[len(fake.destroyIsolatedEnvironmentArgsForCall)]
	fake.destroyIsolatedEnvironmentArgsForCall = append(fake.destroyIsolatedEnvironmentArgsForCall, struct {
		arg1 string
	}{arg1})
	stub := fake.DestroyIsolatedEnvironmentStub
	fakeReturns := fake.destroyIsolatedEnvironmentReturns
	fake.recordInvocation("DestroyIsolatedEnvironment", []interface{}{arg1})
	fake.destroyIsolatedEnvironmentMutex.Unlock()
	if stub != nil {
		return stub(arg1)
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakeIsolationManager) DestroyIsolatedEnvironmentCallCount() int {
	fake.destroyIsolatedEnvironmentMutex.RLock()
	defer fake.destroyIsolatedEnvironmentMutex.RUnlock()
	return len(fake.destroyIsolatedEnvironmentArgsForCall)
}

func (fake *FakeIsolationManager) DestroyIsolatedEnvironmentCalls(stub func(string) error) {
	fake.destroyIsolatedEnvironmentMutex.Lock()
	defer fake.destroyIsolatedEnvironmentMutex.Unlock()
	fake.DestroyIsolatedEnvironmentStub = stub
}

func (fake *FakeIsolationManager) DestroyIsolatedEnvironmentArgsForCall(i int) string {
	fake.destroyIsolatedEnvironmentMutex.RLock()
	defer fake.destroyIsolatedEnvironmentMutex.RUnlock()
	argsForCall := fake.destroyIsolatedEnvironmentArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakeIsolationManager) DestroyIsolatedEnvironmentReturns(result1 error) {
	fake.destroyIsolatedEnvironmentMutex.Lock()
	defer fake.destroyIsolatedEnvironmentMutex.Unlock()
	fake.DestroyIsolatedEnvironmentStub = nil
	fake.destroyIsolatedEnvironmentReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeIsolationManager) DestroyIsolatedEnvironmentReturnsOnCall(i int, result1 error) {
	fake.destroyIsolatedEnvironmentMutex.Lock()
	defer fake.destroyIsolatedEnvironmentMutex.Unlock()
	fake.DestroyIsolatedEnvironmentStub = nil
	if fake.destroyIsolatedEnvironmentReturnsOnCall == nil {
		fake.destroyIsolatedEnvironmentReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.destroyIsolatedEnvironmentReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

func (fake *FakeIsolationManager) MountCUDALibraries(arg1 string, arg2 string) error {
	fake.mountCUDALibrariesMutex.Lock()
	ret, specificReturn := fake.mountCUDALibrariesReturnsOnCall[len(fake.mountCUDALibrariesArgsForCall)]
	fake.mountCUDALibrariesArgsForCall = append(fake.mountCUDALibrariesArgsForCall, struct {
		arg1 string
		arg2 string
	}{arg1, arg2})
	stub := fake.MountCUDALibrariesStub
	fakeReturns := fake.mountCUDALibrariesReturns
	fake.recordInvocation("MountCUDALibraries", []interface{}{arg1, arg2})
	fake.mountCUDALibrariesMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2)
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakeIsolationManager) MountCUDALibrariesCallCount() int {
	fake.mountCUDALibrariesMutex.RLock()
	defer fake.mountCUDALibrariesMutex.RUnlock()
	return len(fake.mountCUDALibrariesArgsForCall)
}

func (fake *FakeIsolationManager) MountCUDALibrariesCalls(stub func(string, string) error) {
	fake.mountCUDALibrariesMutex.Lock()
	defer fake.mountCUDALibrariesMutex.Unlock()
	fake.MountCUDALibrariesStub = stub
}

func (fake *FakeIsolationManager) MountCUDALibrariesArgsForCall(i int) (string, string) {
	fake.mountCUDALibrariesMutex.RLock()
	defer fake.mountCUDALibrariesMutex.RUnlock()
	argsForCall := fake.mountCUDALibrariesArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2
}

func (fake *FakeIsolationManager) MountCUDALibrariesReturns(result1 error) {
	fake.mountCUDALibrariesMutex.Lock()
	defer fake.mountCUDALibrariesMutex.Unlock()
	fake.MountCUDALibrariesStub = nil
	fake.mountCUDALibrariesReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeIsolationManager) MountCUDALibrariesReturnsOnCall(i int, result1 error) {
	fake.mountCUDALibrariesMutex.Lock()
	defer fake.mountCUDALibrariesMutex.Unlock()
	fake.MountCUDALibrariesStub = nil
	if fake.mountCUDALibrariesReturnsOnCall == nil {
		fake.mountCUDALibrariesReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.mountCUDALibrariesReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

func (fake *FakeIsolationManager) Invocations() map[string][][]interface{} {
	fake.invocationsMutex.RLock()
	defer fake.invocationsMutex.RUnlock()
	copiedInvocations := map[string][][]interface{}{}
	for key, value := range fake.invocations {
		copiedInvocations[key] = value
	}
	return copiedInvocations
}

func (fake *FakeIsolationManager) recordInvocation(key string, args []interface{}) {
	fake.invocationsMutex.Lock()
	defer fake.invocationsMutex.Unlock()
	if fake.invocations == nil {
		fake.invocations = map[string][][]interface{}{}
	}
	if fake.invocations[key] == nil {
		fake.invocations[key] = [][]interface{}{}
	}
	fake.invocations[key] = append(fake.invocations[key], args)
}

var _ execution.IsolationManager = new(FakeIsolationManager)
