Lines Matching defs:os
21 import os
34 sysv_generator = os.path.join(os.environ.get('builddir', '.'), 'systemd-sysv-generator')
46 self.init_d_dir = os.path.join(self.workdir, 'init.d')
47 os.mkdir(self.init_d_dir)
49 self.unit_dir = os.path.join(self.workdir, 'systemd')
50 os.mkdir(self.unit_dir)
51 self.out_dir = os.path.join(self.workdir, 'output')
52 os.mkdir(self.out_dir)
68 env = os.environ.copy()
85 if os.path.islink(service):
98 results[os.path.basename(service)] = cp
121 script = os.path.join(self.init_d_dir, fname)
128 os.chmod(script, 0o755)
132 d = os.path.join(self.rcnd_dir, 'rc%s.d' % runlevel)
133 if not os.path.isdir(d):
134 os.mkdir(d)
135 os.symlink('../init.d/' + fname, os.path.join(d, prefix + fname))
151 link = os.path.join(self.out_dir, '%s.target.wants' % target, unit)
153 unit_file = os.readlink(link)
154 self.assertTrue(os.path.exists(unit_file))
155 self.assertEqual(os.path.basename(unit_file), unit)
157 self.assertFalse(os.path.exists(link),
169 self.assertEqual(os.listdir(self.out_dir), [])
179 self.assertEqual(os.listdir(self.out_dir), ['foo.service'])
190 init_script = os.path.join(self.init_d_dir, 'foo')
273 with open(os.path.join(self.init_d_dir, name), 'w') as f:
275 os.fchmod(f.fileno(), 0o755)
277 d = os.path.join(self.rcnd_dir, 'rc2.d')
278 if not os.path.isdir(d):
279 os.mkdir(d)
280 os.symlink('../init.d/' + name, os.path.join(d, 'S%02i%s' % (prio, name)))
298 self.assertEqual(os.readlink(os.path.join(self.out_dir, f)),
308 self.assertEqual(os.readlink(os.path.join(self.out_dir, 'foo\\x2b.service')),
320 self.assertIn(os.readlink(os.path.join(self.out_dir, 'common.service')),
337 os.chmod(self.add_sysv('foo', {}), 0o644)
353 init_script = os.path.join(self.init_d_dir, 'foo.sh')
373 self.assertEqual(os.readlink(os.path.join(self.out_dir, 'bar.service')),
414 with open(os.path.join(self.unit_dir, 'foo.service'), 'w') as f:
421 self.assertEqual(os.listdir(self.out_dir), [])