Logo Search packages:      
Sourcecode: jockey version File versions  Download package

def sandbox::TestOSLib::_make_modprobe (   self  )  [private]

Create a dummy modprobe and set self.modprobe_path.

Definition at line 271 of file sandbox.py.

00271                             :
        '''Create a dummy modprobe and set self.modprobe_path.'''

        self.modprobe_path = os.path.join(self.workdir, 'bin', 'modprobe')
        mp = open(self.modprobe_path, 'w')
        mp.write('''#!/usr/bin/python
import sys

modinfo = %s
proc_modules = %s

if len(sys.argv) != 2:
    print >> sys.stderr, 'Usage: modprobe module'
    sys.exit(1)

m = sys.argv[1]
if m in modinfo:
    if m not in open(proc_modules).read():
        print >> open(proc_modules, 'a'), '%%s 11111 2 - Live 0xbeefbeef' %% m
else:
    print >> sys.stderr, 'FATAL: Module %%s not found.' %% m
    sys.exit(1)
''' % (repr(fake_modinfo), repr(self.proc_modules)))

        mp.close()
        os.chmod(self.modprobe_path, 0755)
        
    def _make_sys(self):


Generated by  Doxygen 1.6.0   Back to index