github.com/pf-qiu/concourse/v6@v6.7.3-0.20201207032516-1f455d73275f/worker/runtime/runtimefakes/fake_rootfs_manager.go (about)

     1  // Code generated by counterfeiter. DO NOT EDIT.
     2  package runtimefakes
     3  
     4  import (
     5  	"sync"
     6  
     7  	"github.com/pf-qiu/concourse/v6/worker/runtime"
     8  	specs "github.com/opencontainers/runtime-spec/specs-go"
     9  )
    10  
    11  type FakeRootfsManager struct {
    12  	LookupUserStub        func(string, string) (specs.User, bool, error)
    13  	lookupUserMutex       sync.RWMutex
    14  	lookupUserArgsForCall []struct {
    15  		arg1 string
    16  		arg2 string
    17  	}
    18  	lookupUserReturns struct {
    19  		result1 specs.User
    20  		result2 bool
    21  		result3 error
    22  	}
    23  	lookupUserReturnsOnCall map[int]struct {
    24  		result1 specs.User
    25  		result2 bool
    26  		result3 error
    27  	}
    28  	SetupCwdStub        func(string, string) error
    29  	setupCwdMutex       sync.RWMutex
    30  	setupCwdArgsForCall []struct {
    31  		arg1 string
    32  		arg2 string
    33  	}
    34  	setupCwdReturns struct {
    35  		result1 error
    36  	}
    37  	setupCwdReturnsOnCall map[int]struct {
    38  		result1 error
    39  	}
    40  	invocations      map[string][][]interface{}
    41  	invocationsMutex sync.RWMutex
    42  }
    43  
    44  func (fake *FakeRootfsManager) LookupUser(arg1 string, arg2 string) (specs.User, bool, error) {
    45  	fake.lookupUserMutex.Lock()
    46  	ret, specificReturn := fake.lookupUserReturnsOnCall[len(fake.lookupUserArgsForCall)]
    47  	fake.lookupUserArgsForCall = append(fake.lookupUserArgsForCall, struct {
    48  		arg1 string
    49  		arg2 string
    50  	}{arg1, arg2})
    51  	fake.recordInvocation("LookupUser", []interface{}{arg1, arg2})
    52  	fake.lookupUserMutex.Unlock()
    53  	if fake.LookupUserStub != nil {
    54  		return fake.LookupUserStub(arg1, arg2)
    55  	}
    56  	if specificReturn {
    57  		return ret.result1, ret.result2, ret.result3
    58  	}
    59  	fakeReturns := fake.lookupUserReturns
    60  	return fakeReturns.result1, fakeReturns.result2, fakeReturns.result3
    61  }
    62  
    63  func (fake *FakeRootfsManager) LookupUserCallCount() int {
    64  	fake.lookupUserMutex.RLock()
    65  	defer fake.lookupUserMutex.RUnlock()
    66  	return len(fake.lookupUserArgsForCall)
    67  }
    68  
    69  func (fake *FakeRootfsManager) LookupUserCalls(stub func(string, string) (specs.User, bool, error)) {
    70  	fake.lookupUserMutex.Lock()
    71  	defer fake.lookupUserMutex.Unlock()
    72  	fake.LookupUserStub = stub
    73  }
    74  
    75  func (fake *FakeRootfsManager) LookupUserArgsForCall(i int) (string, string) {
    76  	fake.lookupUserMutex.RLock()
    77  	defer fake.lookupUserMutex.RUnlock()
    78  	argsForCall := fake.lookupUserArgsForCall[i]
    79  	return argsForCall.arg1, argsForCall.arg2
    80  }
    81  
    82  func (fake *FakeRootfsManager) LookupUserReturns(result1 specs.User, result2 bool, result3 error) {
    83  	fake.lookupUserMutex.Lock()
    84  	defer fake.lookupUserMutex.Unlock()
    85  	fake.LookupUserStub = nil
    86  	fake.lookupUserReturns = struct {
    87  		result1 specs.User
    88  		result2 bool
    89  		result3 error
    90  	}{result1, result2, result3}
    91  }
    92  
    93  func (fake *FakeRootfsManager) LookupUserReturnsOnCall(i int, result1 specs.User, result2 bool, result3 error) {
    94  	fake.lookupUserMutex.Lock()
    95  	defer fake.lookupUserMutex.Unlock()
    96  	fake.LookupUserStub = nil
    97  	if fake.lookupUserReturnsOnCall == nil {
    98  		fake.lookupUserReturnsOnCall = make(map[int]struct {
    99  			result1 specs.User
   100  			result2 bool
   101  			result3 error
   102  		})
   103  	}
   104  	fake.lookupUserReturnsOnCall[i] = struct {
   105  		result1 specs.User
   106  		result2 bool
   107  		result3 error
   108  	}{result1, result2, result3}
   109  }
   110  
   111  func (fake *FakeRootfsManager) SetupCwd(arg1 string, arg2 string) error {
   112  	fake.setupCwdMutex.Lock()
   113  	ret, specificReturn := fake.setupCwdReturnsOnCall[len(fake.setupCwdArgsForCall)]
   114  	fake.setupCwdArgsForCall = append(fake.setupCwdArgsForCall, struct {
   115  		arg1 string
   116  		arg2 string
   117  	}{arg1, arg2})
   118  	fake.recordInvocation("SetupCwd", []interface{}{arg1, arg2})
   119  	fake.setupCwdMutex.Unlock()
   120  	if fake.SetupCwdStub != nil {
   121  		return fake.SetupCwdStub(arg1, arg2)
   122  	}
   123  	if specificReturn {
   124  		return ret.result1
   125  	}
   126  	fakeReturns := fake.setupCwdReturns
   127  	return fakeReturns.result1
   128  }
   129  
   130  func (fake *FakeRootfsManager) SetupCwdCallCount() int {
   131  	fake.setupCwdMutex.RLock()
   132  	defer fake.setupCwdMutex.RUnlock()
   133  	return len(fake.setupCwdArgsForCall)
   134  }
   135  
   136  func (fake *FakeRootfsManager) SetupCwdCalls(stub func(string, string) error) {
   137  	fake.setupCwdMutex.Lock()
   138  	defer fake.setupCwdMutex.Unlock()
   139  	fake.SetupCwdStub = stub
   140  }
   141  
   142  func (fake *FakeRootfsManager) SetupCwdArgsForCall(i int) (string, string) {
   143  	fake.setupCwdMutex.RLock()
   144  	defer fake.setupCwdMutex.RUnlock()
   145  	argsForCall := fake.setupCwdArgsForCall[i]
   146  	return argsForCall.arg1, argsForCall.arg2
   147  }
   148  
   149  func (fake *FakeRootfsManager) SetupCwdReturns(result1 error) {
   150  	fake.setupCwdMutex.Lock()
   151  	defer fake.setupCwdMutex.Unlock()
   152  	fake.SetupCwdStub = nil
   153  	fake.setupCwdReturns = struct {
   154  		result1 error
   155  	}{result1}
   156  }
   157  
   158  func (fake *FakeRootfsManager) SetupCwdReturnsOnCall(i int, result1 error) {
   159  	fake.setupCwdMutex.Lock()
   160  	defer fake.setupCwdMutex.Unlock()
   161  	fake.SetupCwdStub = nil
   162  	if fake.setupCwdReturnsOnCall == nil {
   163  		fake.setupCwdReturnsOnCall = make(map[int]struct {
   164  			result1 error
   165  		})
   166  	}
   167  	fake.setupCwdReturnsOnCall[i] = struct {
   168  		result1 error
   169  	}{result1}
   170  }
   171  
   172  func (fake *FakeRootfsManager) Invocations() map[string][][]interface{} {
   173  	fake.invocationsMutex.RLock()
   174  	defer fake.invocationsMutex.RUnlock()
   175  	fake.lookupUserMutex.RLock()
   176  	defer fake.lookupUserMutex.RUnlock()
   177  	fake.setupCwdMutex.RLock()
   178  	defer fake.setupCwdMutex.RUnlock()
   179  	copiedInvocations := map[string][][]interface{}{}
   180  	for key, value := range fake.invocations {
   181  		copiedInvocations[key] = value
   182  	}
   183  	return copiedInvocations
   184  }
   185  
   186  func (fake *FakeRootfsManager) recordInvocation(key string, args []interface{}) {
   187  	fake.invocationsMutex.Lock()
   188  	defer fake.invocationsMutex.Unlock()
   189  	if fake.invocations == nil {
   190  		fake.invocations = map[string][][]interface{}{}
   191  	}
   192  	if fake.invocations[key] == nil {
   193  		fake.invocations[key] = [][]interface{}{}
   194  	}
   195  	fake.invocations[key] = append(fake.invocations[key], args)
   196  }
   197  
   198  var _ runtime.RootfsManager = new(FakeRootfsManager)