Ejemplo n.º 1
0
 def test_ReadFileFilter(self):
     goodfn = '/good/file.name'
     f = filters.ReadFileFilter(goodfn)
     usercmd = ['cat', '/bad/file']
     self.assertFalse(f.match(['cat', '/bad/file']))
     usercmd = ['cat', goodfn]
     self.assertEqual(f.get_command(usercmd), ['/bin/cat', goodfn])
     self.assertTrue(f.match(usercmd))
Ejemplo n.º 2
0
    # nova/network/linux_net.py: dnsmasq call
    filters.DnsmasqFilter("/usr/sbin/dnsmasq", "root"),

    # nova/network/linux_net.py: 'radvd', '-C', '%s' % _ra_file(dev, 'conf'),..
    filters.CommandFilter("/usr/sbin/radvd", "root"),

    # nova/network/linux_net.py: 'brctl', 'addbr', bridge
    # nova/network/linux_net.py: 'brctl', 'setfd', bridge, 0
    # nova/network/linux_net.py: 'brctl', 'stp', bridge, 'off'
    # nova/network/linux_net.py: 'brctl', 'addif', bridge, interface
    filters.CommandFilter("/sbin/brctl", "root"),
    filters.CommandFilter("/usr/sbin/brctl", "root"),

    # nova/virt/libvirt/utils.py: 'mkswap'
    # nova/virt/xenapi/vm_utils.py: 'mkswap'
    filters.CommandFilter("/sbin/mkswap", "root"),

    # nova/virt/xenapi/vm_utils.py: 'mkfs'
    filters.CommandFilter("/sbin/mkfs", "root"),

    # nova/virt/libvirt/utils.py: 'qemu-img'
    filters.CommandFilter("/usr/bin/qemu-img", "root"),

    # nova/virt/disk/api.py: 'touch', target
    filters.CommandFilter("/usr/bin/touch", "root"),

    # nova/virt/libvirt/connection.py:
    filters.ReadFileFilter("/etc/iscsi/initiatorname.iscsi"),
]