lib/Mojo/IOLoop/ReadWriteProcess/CGroup/v1/Devices.pm

filter: Statementstmt 90.9% 10 / 11 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 80.0% 4 / 5 Podpod 0.0% 0 / 2 totaltotal 77.7% 14 / 18 CC 1 SCAR 0.2
CC
1
Cov
91%
__ANON__
1.1
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« lib/Mojo/IOLoop/ReadWriteProcess/CGroup/v2/IO.pm ↑ Summary lib/Mojo/IOLoop/ReadWriteProcess/CGroup/v1/Netprio.pm »
1 package Mojo::IOLoop::ReadWriteProcess::CGroup::v1::Devices;
2  
3 15 ▶use Mojo::Base -base;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 15 ▶use constant {
Subroutine BEGIN: called CC=1 SCAR=0.0
6 15 DEVICES_ALLOW_INTERFACE => 'devices.allow',
7 DEVICES_DENY_INTERFACE => 'devices.deny'
8 15 };
9  
10 0 ▶has cgroup => sub { Mojo::IOLoop::ReadWriteProcess::CGroup::v1->new };
Subroutine __ANON__: not called CC=1 SCAR=1.2
11  
12 1 ▶sub allow { shift->cgroup->_write(DEVICES_ALLOW_INTERFACE, @_) }
Subroutine allow: called CC=1 SCAR=0.0
Pod undocumented
13 1 ▶sub deny { shift->cgroup->_write(DEVICES_DENY_INTERFACE, @_) }
Subroutine deny: called CC=1 SCAR=0.0
Pod undocumented
14  
15 15 1;
16  
17 =encoding utf-8
18  
19 =head1 NAME
20  
21 Mojo::IOLoop::ReadWriteProcess::CGroup::v1::Devices - CGroups v1 Devices Controller.
22  
23 =head1 SYNOPSIS
24  
25 use Mojo::IOLoop::ReadWriteProcess::CGroup::v1;
26  
27 my $cgroup = Mojo::IOLoop::ReadWriteProcess::CGroup::v1->new( name => "test" );
28  
29 $cgroup->devices->allow('a *:* rwm');
30  
31 =head1 DESCRIPTION
32  
33 This module uses features that are only available on Linux,
34 and requires cgroups and capability for unshare syscalls to achieve pid isolation.
35  
36 =head1 METHODS
37  
38 L<Mojo::IOLoop::ReadWriteProcess::CGroup::v1::Devices> inherits all methods from L<Mojo::Base> and implements
39 the following new ones.
40  
41 =head1 LICENSE
42  
43 Copyright (C) Ettore Di Giacinto.
44  
45 This library is free software; you can redistribute it and/or modify
46 it under the same terms as Perl itself.
47  
48 =head1 AUTHOR
49  
50 Ettore Di Giacinto E<lt>edigiacinto@suse.comE<gt>
51  
52 =cut
« lib/Mojo/IOLoop/ReadWriteProcess/CGroup/v2/IO.pm ↑ Summary lib/Mojo/IOLoop/ReadWriteProcess/CGroup/v1/Netprio.pm »