source
stringclasses
1 value
repo
stringlengths
5
63
repo_url
stringlengths
24
82
path
stringlengths
5
167
language
stringclasses
1 value
license
stringclasses
5 values
stars
int64
10
51.4k
ref
stringclasses
23 values
size_bytes
int64
200
258k
text
stringlengths
137
258k
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/backend/dockercli/build_command_spec.rb
Ruby
mit
300
master
5,869
# frozen_string_literal: true require 'spec_helper' require 'shellwords' describe Specinfra::Backend::Dockercli do let(:interactive_shell) { false } let(:login_shell) { false } let(:request_pty) { false } let(:shell) { '/bin/sh' } let(:docker_container) { 'instance' } let(:path) { nil } let(:docker_exec...
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/host_inventory/base/user_spec.rb
Ruby
mit
300
master
5,315
require 'spec_helper' str = <<-EOH root:x:0:0:root:/root:/bin/bash bin:x:1:1:bin:/bin:/sbin/nologin daemon:x:2:2:daemon:/sbin:/sbin/nologin adm:x:3:4:adm:/var/adm:/sbin/nologin lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin sync:x:5:0:sync:/sbin:/bin/sync shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown halt:x:7:0:halt:/sbin:/s...
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/host_inventory/base/group_spec.rb
Ruby
mit
300
master
3,615
require 'spec_helper' str = <<-EOH root:x:0: bin:x:1: daemon:x:2: sys:x:3: adm:x:4: tty:x:5: disk:x:6: lp:x:7: mem:x:8: kmem:x:9: wheel:x:10:hoge cdrom:x:11: mail:x:12:postfix man:x:15: dialout:x:18: floppy:x:19: games:x:20: tape:x:30: video:x:39: ftp:x:50: lock:x:54: audio:x:63: nobody:x:99: users:x:100: avahi-autoip...
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/host_inventory/openbsd/virtualization_spec.rb
Ruby
mit
300
master
806
require 'spec_helper' describe Specinfra::HostInventory::Virtualization do before :all do set :os, { :family => 'openbsd' } end virt = Specinfra::HostInventory::Virtualization.new(host_inventory) let(:host_inventory) { nil } it 'OpenBSD 5.7 on KVM should return :system => "kvm"' do ret = virt.pars...
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/host_inventory/openbsd/filesystem_spec.rb
Ruby
mit
300
master
1,286
require 'spec_helper' ## Output from 'df -kP' str = <<-EOH Filesystem 1024-blocks Used Available Capacity Mounted on /dev/sd0a 1013006 58408 903948 6% / /dev/sd0e 1822574 18 1731428 0% /home /dev/sd0d 3093230 372244 2566326 13% /usr EOH describ...
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/host_inventory/aix/filesystem_spec.rb
Ruby
mit
300
master
3,394
require 'spec_helper' # Output from 'df -kP' str = <<-EOH Filesystem 1024-blocks Used Available Capacity Mounted on /dev/hd4 524288 67328 456960 13% / /dev/hd2 4194304 3077768 1116536 74% /usr /dev/hd9var 3145728 96588 3049140 4% /var /dev/hd3 20971...
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/host_inventory/linux/memory_spec.rb
Ruby
mit
300
master
4,135
require 'spec_helper' str = <<-EOH MemTotal: 1019392 kB MemFree: 88248 kB Buffers: 26016 kB Cached: 312856 kB SwapCached: 87708 kB Active: 396664 kB Inactive: 444580 kB Active(anon): 242816 kB Inactive(anon): 308412 kB Active(file): 153848 kB Inac...
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/host_inventory/linux/virtualization_spec.rb
Ruby
mit
300
master
2,528
require 'spec_helper' describe Specinfra::HostInventory::Virtualization do before :all do set :os, { :family => 'linux' } end virt = Specinfra::HostInventory::Virtualization.new(host_inventory) let(:host_inventory) { nil } it 'Docker Image should return :system => "docker"' do allow(virt.backend).to...
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/host_inventory/linux/cpu_spec.rb
Ruby
mit
300
master
3,036
require 'spec_helper' str = <<-EOH processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 60 model name : Intel(R) Core(TM) i5-4590 CPU @ 3.30GHz stepping : 3 microcode : 0x19 cpu MHz : 3132.076 cache size : 6144 KB physical id : 0 siblings : 2 core id : 0 cpu cores : 2 apicid : 0 initial apicid : 0 fpu : ...
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/host_inventory/linux/filesystem_spec.rb
Ruby
mit
300
master
1,840
require 'spec_helper' ## Output from 'df -P' str = <<-EOH Filesystem 1024-blocks Used Available Capacity Mounted on /dev/mapper/vg_idefix-lv_root 51475068 8840540 40013088 19% / tmpfs 509696 872 508824 1% /dev/shm /dev/sdb3 ...
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/host_inventory/linux/kernel_spec.rb
Ruby
mit
300
master
903
require 'spec_helper' describe Specinfra::HostInventory::Kernel do describe 'Example of CentOS 6.6 Kernel version 2.6.32-504.30.3.el6.x86_64' do str = 'Linux 2.6.32-504.30.3.el6.x86_64' let(:host_inventory) { nil } ret = Specinfra::HostInventory::Kernel.new(host_inventory).parse_uname(str) example "...
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/host_inventory/linux/block_device_spec.rb
Ruby
mit
300
master
1,320
require 'spec_helper' ## Output from: # # for f in $(ls /sys/block/*/{size,removable,device/{model,rev,state,timeout,vendor},queue/rotational}); do # echo -e "${f}\t$(cat ${f})" # done str = <<-EOH /sys/block/loop0/queue/rotational 1 /sys/block/loop0/removable 0 /sys/block/loop0/size 0 /sys/block/sda/device/model ...
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/host_inventory/freebsd/filesystem_spec.rb
Ruby
mit
300
master
4,015
require 'spec_helper' ## Output from 'df -k' str = <<-EOH Filesystem 1024-blocks Used Avail Capacity Mounted on zroot/ROOT/default 2500692 1345720 1154972 54% / devfs 1 1 0 100% /dev zroot/tmp 1155148 176 1154972 0% /tmp zroot/usr/...
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/host_inventory/guix/filesystem_spec.rb
Ruby
mit
300
master
1,727
require 'spec_helper' ## Output from 'df -k' str = <<-EOH Filesystem 1K-blocks Used Available Use% Mounted on none 4015168 0 4015168 0% /dev /dev/sda3 235797392 184584640 39162064 83% / /dev/sda1 523248 3640 519608 1% /boot/efi tmpfs 4025296 105...
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/host_inventory/solaris/filesystem_spec.rb
Ruby
mit
300
master
4,674
require 'spec_helper' # Output from df -k | nawk -v i=0 '$1 == "swap" { $1=$1i; i++ }; NF == 1 { printf($1); next }; { print }' str = <<-EOH Filesystem kbytes used avail capacity Mounted on / 32769183 5637051 27132132 18% / /dev 32769183 5637051 27132132 18%...
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/host_inventory/solaris/virtualization_spec.rb
Ruby
mit
300
master
905
require 'spec_helper' describe Specinfra::HostInventory::Virtualization do before :all do set :os, { :family => 'solaris' } end virt = Specinfra::HostInventory::Virtualization.new(host_inventory) let(:host_inventory) { nil } it 'OpenIndiana on KVM should return :system => "kvm"' do ret = virt.pars...
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/host_inventory/darwin/filesystem_spec.rb
Ruby
mit
300
master
2,140
require 'spec_helper' ## Output from 'df -k' str = <<-EOH Filesystem 1024-blocks Used Available Capacity Mounted on /dev/disk0s2 243358976 213852680 29250296 88% / devfs 126 126 0 100% /dev map -hosts ...
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/host_inventory/darwin/kernel_spec.rb
Ruby
mit
300
master
611
require 'spec_helper' describe Specinfra::HostInventory::Kernel do describe "get" do let(:host_inventory) { Specinfra::HostInventory.instance } let(:command_class) { Specinfra::Command::Darwin::Base } let(:error_message) { "get_kernel is not implemented in #{command_class}" } let(:kernel_inventory) {...
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/command/factory_spec.rb
Ruby
mit
300
master
920
require 'spec_helper' describe 'create_command_class work correctly' do before do property[:os] = nil end context 'family: base, release: nil' do before do set :os, :family => 'base' end it { expect(Specinfra.command.send(:create_command_class, 'file')).to eq Specinfra::Command::Base::File...
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/command/alpine/service_spec.rb
Ruby
mit
300
master
561
require 'spec_helper' property[:os] = nil set :os, :family => 'alpine' describe get_command(:enable_service, 'nginx') do it { should eq 'rc-update add nginx' } end describe get_command(:disable_service, 'nginx') do it { should eq 'rc-update del nginx' } end describe get_command(:start_service, 'nginx') do it ...
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/command/openbsd57/service_spec.rb
Ruby
mit
300
master
887
require 'spec_helper' property[:os] = nil set :os, :family => 'openbsd', :release => '5.7' describe get_command(:check_service_is_enabled, 'httpd') do it { should eq 'rcctl get httpd status' } end describe get_command(:check_service_is_running, 'httpd') do it { should eq 'rcctl check httpd' } end describe get_c...
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/command/module/systemd_spec.rb
Ruby
mit
300
master
675
require 'spec_helper' describe Specinfra::Command::Redhat::V7::Service do let(:klass) { Specinfra::Command::Redhat::V7::Service } it { expect(klass.check_is_enabled('httpd')).to eq "systemctl --quiet is-enabled httpd" } it { expect(klass.check_is_enabled('httpd', 'multi-user.target')).to eq "systemctl --quiet is...
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/command/module/ss_spec.rb
Ruby
mit
300
master
2,604
require 'spec_helper' describe Specinfra::Command::Module::Ss do class Specinfra::Command::Module::Ss::Test < Specinfra::Command::Base extend Specinfra::Command::Module::Ss end let(:klass) { Specinfra::Command::Module::Ss::Test } it { expect(klass.check_is_listening('80')).to eq 'ss -tunl | grep -E -- :80\...
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/command/module/zfs_spec.rb
Ruby
mit
300
master
348
require 'spec_helper' describe Specinfra::Command::Solaris::Base::Zfs do let(:klass) { Specinfra::Command::Solaris::Base::Zfs } it { expect(klass.check_exists('rpool')).to eq "zfs list -H rpool" } it { expect(klass.check_has_property('rpool', {'mountpoint' => '/rpool' })).to eq "zfs list -H -o mountpoint rpool | ...
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/command/module/service/daemontools_spec.rb
Ruby
mit
300
master
1,666
require 'spec_helper' describe Specinfra::Command::Module::Service::Daemontools do class Specinfra::Command::Module::Service::Daemontools::Test < Specinfra::Command::Base extend Specinfra::Command::Module::Service::Daemontools end let(:klass) { Specinfra::Command::Module::Service::Daemontools::Test } it { ...
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/command/module/service/runit_spec.rb
Ruby
mit
300
master
1,022
require 'spec_helper' describe Specinfra::Command::Module::Service::Runit do class Specinfra::Command::Module::Service::Runit::Test < Specinfra::Command::Base extend Specinfra::Command::Module::Service::Runit end let(:klass) { Specinfra::Command::Module::Service::Runit::Test } it { expect(klass.check_is_en...
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/command/module/service/init_spec.rb
Ruby
mit
300
master
958
require 'spec_helper' describe Specinfra::Command::Module::Service::Init do class Specinfra::Command::Module::Service::Init::Test < Specinfra::Command::Base extend Specinfra::Command::Module::Service::Init end let(:klass) { Specinfra::Command::Module::Service::Init::Test } it { expect(klass.check_is_enable...
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/command/module/service/systemd_spec.rb
Ruby
mit
300
master
1,013
require 'spec_helper' describe Specinfra::Command::Module::Service::Systemd do class Specinfra::Command::Module::Service::Systemd::Test < Specinfra::Command::Base extend Specinfra::Command::Module::Service::Systemd end let(:klass) { Specinfra::Command::Module::Service::Systemd::Test } it { expect(klass.che...
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/command/amazon2022/port_spec.rb
Ruby
mit
300
master
202
require 'spec_helper' property[:os] = nil set :os, :family => 'amazon', :release => '2022' describe get_command(:check_port_is_listening, '80') do it { should eq 'ss -tunl | grep -E -- :80\ ' } end
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/command/amazon2022/package_spec.rb
Ruby
mit
300
master
1,063
require 'spec_helper' property[:os] = nil set :os, :family => 'amazon', :release => '2022' describe get_command(:check_package_is_installed, 'telnet') do it { should eq 'rpm -q telnet' } end describe get_command(:check_package_is_installed, 'telnet', '0.17-48.el6.x86_64') do it { should eq 'rpm -q telnet | gre...
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/command/amazon2022/service_spec.rb
Ruby
mit
300
master
795
require 'spec_helper' property[:os] = nil set :os, :family => 'amazon', :release => '2022' describe get_command(:enable_service, 'httpd') do it { should eq 'systemctl enable httpd' } end describe get_command(:disable_service, 'httpd') do it { should eq 'systemctl disable httpd' } end describe get_command(:start...
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/command/amazon2022/yumrepo_spec.rb
Ruby
mit
300
master
373
require 'spec_helper' property[:os] = nil set :os, :family => 'amazon', :release => '2022' describe get_command(:check_yumrepo_exists, 'epel') do it { should eq "dnf repolist all | grep -qsE \"^[\\!\\*]?epel\(\\s\|$\|\\/)\"" } end describe get_command(:check_yumrepo_is_enabled, 'epel') do it { should eq "dnf rep...
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/command/debiantesting/service_spec.rb
Ruby
mit
300
master
269
require 'spec_helper' property[:os] = nil set :os, :family => 'debian', :release => 'testing' describe get_command(:check_service_is_enabled, 'apache') do it { should eq 'systemctl --quiet is-enabled apache||ls /etc/rc[S5].d/S??apache >/dev/null 2>/dev/null' } end
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/command/debiantesting/port_spec.rb
Ruby
mit
300
master
205
require 'spec_helper' property[:os] = nil set :os, :family => 'debian', :release => 'testing' describe get_command(:check_port_is_listening, '80') do it { should eq 'ss -tunl | grep -E -- :80\ ' } end
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/command/darwin/interface_spec.rb
Ruby
mit
300
master
1,794
require 'spec_helper' property[:os] = nil set :os, :family => 'darwin' describe get_command(:check_interface_exists, 'en0') do it { should eq "ifconfig en0" } end describe get_command(:check_interface_has_ipv6_address, 'en0', '2001:0db8:bd05:01d2:288a:1fc0:0001:10ee') do it { should eq "ifconfig en0 inet6 | gre...
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/command/darwin/process_spec.rb
Ruby
mit
300
master
247
require 'spec_helper' set :os, { :family => 'darwin' } describe get_command(:get_process, 'Google Chrome', :format => 'pid=') do it { should eq "ps -A -c -o pid=,command | grep -E -m 1 ^\\ *[0-9]+\\ +Google\\ Chrome$ | awk '{print $1}'" } end
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/command/darwin/host_spec.rb
Ruby
mit
300
master
1,510
require 'spec_helper' property[:os] = nil set :os, :family => 'darwin' describe get_command(:check_host_is_resolvable, 'pink.unicorn.com', 'dns') do it { should eq "dig +search +short +time=1 -q pink.unicorn.com a pink.unicorn.com aaaa | grep -qie '^[0-9a-f:.]*$'" } end describe get_command(:check_host_is_resolv...
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/command/darwin/port_spec.rb
Ruby
mit
300
master
331
require 'spec_helper' property[:os] = nil set :os, :family => 'darwin' describe get_command(:check_port_is_listening, '80') do it { should eq 'lsof -nP -iTCP -sTCP:LISTEN | grep -- :80\ ' } end describe get_command(:check_port_is_listening, '80', :protocol => 'udp') do it { should eq 'lsof -nP -iUDP | grep -- :8...
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/command/darwin/group_spec.rb
Ruby
mit
300
master
545
require 'spec_helper' set :os, { :family => 'darwin' } describe get_command(:get_group_gid, 'foo') do it { should eq "dscl . -read /Groups/foo PrimaryGroupID | awk '{ print $2 }'" } end describe get_command(:update_group_gid, 'foo', 1234) do it { should eq "dscl . -create /Groups/foo PrimaryGroupID 1234" } end ...
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/command/darwin/user_spec.rb
Ruby
mit
300
master
1,471
require 'spec_helper' set :os, { :family => 'darwin' } describe get_command(:check_user_has_home_directory, 'foo', '/Users/foo') do it { should eq "finger foo | grep -E '^Directory' | awk '{ print $2 }' | grep -E '^/Users/foo$'" } end describe get_command(:check_user_has_login_shell, 'foo', '/bin/bash') do it { ...
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/command/darwin/file_spec.rb
Ruby
mit
300
master
507
require 'spec_helper' property[:os] = nil set :os, :family => 'darwin' describe get_command(:get_file_sha256sum, '/etc/services') do it { should eq 'ruby -e "require \'digest\'; puts Digest::SHA256.hexdigest File.read \'/etc/services\'"' } end describe get_command(:check_file_is_owned_by, '/tmp', 'root') do it {...
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/command/redhat/package_spec.rb
Ruby
mit
300
master
1,047
require 'spec_helper' property[:os] = nil set :os, { :family => 'redhat' } describe get_command(:check_package_is_installed, 'telnet') do it { should eq 'rpm -q telnet' } end describe get_command(:check_package_is_installed, 'telnet', '0.17-48.el6.x86_64') do it { should eq 'rpm -q telnet | grep -w -- telnet\\...
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/command/redhat/service_spec.rb
Ruby
mit
300
master
648
require 'spec_helper' property[:os] = nil set :os, :family => 'redhat' describe get_command(:enable_service, 'httpd') do it { should eq 'chkconfig httpd on' } end describe get_command(:disable_service, 'httpd') do it { should eq 'chkconfig httpd off' } end describe get_command(:start_service, 'httpd') do it {...
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/command/debianunstable/service_spec.rb
Ruby
mit
300
master
270
require 'spec_helper' property[:os] = nil set :os, :family => 'debian', :release => 'unstable' describe get_command(:check_service_is_enabled, 'apache') do it { should eq 'systemctl --quiet is-enabled apache||ls /etc/rc[S5].d/S??apache >/dev/null 2>/dev/null' } end
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/command/debianunstable/port_spec.rb
Ruby
mit
300
master
206
require 'spec_helper' property[:os] = nil set :os, :family => 'debian', :release => 'unstable' describe get_command(:check_port_is_listening, '80') do it { should eq 'ss -tunl | grep -E -- :80\ ' } end
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/command/freebsd/service_spec.rb
Ruby
mit
300
master
3,141
require 'spec_helper' describe 'command/freebsd/service works correctly' do before do property[:os] = nil end describe 'check_service_is_enabled' do context 'freebsd-base' do before do set :os, :family => 'freebsd' end describe 'get_command(:check_service_is_enabled, "httpd")' ...
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/command/freebsd/package_spec.rb
Ruby
mit
300
master
6,660
require 'spec_helper' describe 'command/freebsd/package works correctly' do before do property[:os] = nil end context 'freebsd-base' do before do set :os, :family => 'freebsd' end describe 'get_command(:check_package_is_installed, "figlet")' do it { expect(get_command(:check_package...
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/command/freebsd/host_spec.rb
Ruby
mit
300
master
855
require 'spec_helper' property[:os] = nil set :os, :family => 'freebsd' describe get_command(:check_host_is_reachable, 'pink.unicorn.com', nil, 'tcp', 10) do it { should eq "ping -t 10 -c 2 -n pink.unicorn.com"} end describe get_command(:check_host_is_reachable, 'pink.unicorn.com', 53, 'udp', 66) do it { shou...
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/command/freebsd/interface_spec.rb
Ruby
mit
300
master
2,063
require 'spec_helper' property[:os] = nil set :os, :family => 'freebsd' describe get_command(:check_interface_has_ipv6_address, 'vtnet0', '2001:0db8:bd05:01d2:288a:1fc0:0001:10ee') do it { should eq "ifconfig vtnet0 inet6 | grep 'inet6 2001:0db8:bd05:01d2:288a:1fc0:0001:10ee '" } end describe get_command(:check_in...
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/command/freebsd/file_spec.rb
Ruby
mit
300
master
330
require 'spec_helper' property[:os] = nil set :os, :family => 'freebsd' describe get_command(:check_file_is_owned_by, '/tmp', 'root') do it { should eq 'stat -f%Su /tmp | grep -- \\^root\\$' } end describe get_command(:check_file_is_grouped, '/tmp', 'wheel') do it { should eq 'stat -f%Sg /tmp | grep -- \\^wheel\...
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/command/esxi/package_spec.rb
Ruby
mit
300
master
363
require 'spec_helper' property[:os] = nil set :os, { :family => 'esxi' } describe get_command(:check_package_is_installed, 'httpd') do it { should eq 'esxcli software vib list | grep -w -- httpd' } end describe get_command(:check_package_is_installed, 'httpd', '2.0') do it { should eq 'esxcli software vib list...
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/command/guix/service_spec.rb
Ruby
mit
300
master
538
require 'spec_helper' property[:os] = nil set :os, :family => 'guix' describe get_command(:enable_service, 'nginx') do it { should eq 'herd enable nginx' } end describe get_command(:disable_service, 'nginx') do it { should eq 'herd disable nginx' } end describe get_command(:start_service, 'nginx') do it { sho...
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/command/redhat7/interface_spec.rb
Ruby
mit
300
master
247
require 'spec_helper' property[:os] = nil set :os, { :family => 'redhat', :release => 7 } describe Specinfra.command.send(:create_command_class, 'interface') do it { should be_an_instance_of(Specinfra::Command::Linux::Base::Interface) } end
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/command/redhat7/host_spec.rb
Ruby
mit
300
master
875
require 'spec_helper' property[:os] = nil set :os, :family => 'redhat', :release => '7' describe get_command(:check_host_is_reachable, 'example.jp', '53', 'udp', 2) do it { should eq "ncat -vvvvu example.jp 53 -w 2 -i 2 2>&1 | grep -q SUCCESS" } end describe get_command(:check_host_is_reachable, 'example.jp', '...
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/command/redhat7/service_spec.rb
Ruby
mit
300
master
792
require 'spec_helper' property[:os] = nil set :os, :family => 'redhat', :release => '7' describe get_command(:enable_service, 'httpd') do it { should eq 'systemctl enable httpd' } end describe get_command(:disable_service, 'httpd') do it { should eq 'systemctl disable httpd' } end describe get_command(:start_se...
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/command/ubuntu/ppa_spec.rb
Ruby
mit
300
master
449
require 'spec_helper' property[:os] = nil set :os, :family => 'ubuntu' describe get_command(:check_ppa_exists, 'nginx/stable') do it { should eq %(find /etc/apt/ -name *.list | xargs grep -o -E "deb +[\\\"']?http://ppa.launchpad.net/nginx/stable") } end describe get_command(:check_ppa_is_enabled, 'nginx/stable') d...
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/command/amazon/interface_spec.rb
Ruby
mit
300
master
249
require 'spec_helper' property[:os] = nil set :os, { :family => 'amazon', :release => nil } describe Specinfra.command.send(:create_command_class, 'interface') do it { should be_an_instance_of(Specinfra::Command::Linux::Base::Interface) } end
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/command/amazon/service_spec.rb
Ruby
mit
300
master
648
require 'spec_helper' property[:os] = nil set :os, :family => 'amazon' describe get_command(:enable_service, 'httpd') do it { should eq 'chkconfig httpd on' } end describe get_command(:disable_service, 'httpd') do it { should eq 'chkconfig httpd off' } end describe get_command(:start_service, 'httpd') do it {...
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/command/debian/package_spec.rb
Ruby
mit
300
master
1,534
require 'spec_helper' property[:os] = nil set :os, :family => 'debian' describe get_command(:check_package_is_installed, 'telnet') do it { should eq "dpkg-query -f '${Status}' -W telnet | grep -E '^(install|hold) ok installed$'" } end describe get_command(:check_package_is_installed, 'telnet', '0.17-36build2') do ...
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/command/debian/service_spec.rb
Ruby
mit
300
master
688
require 'spec_helper' property[:os] = nil set :os, :family => 'debian' describe get_command(:enable_service, 'apache2') do it { should eq 'update-rc.d apache2 defaults' } end describe get_command(:disable_service, 'apache2') do it { should eq 'update-rc.d -f apache2 remove' } end describe get_command(:start_ser...
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/command/amazon2/service_spec.rb
Ruby
mit
300
master
792
require 'spec_helper' property[:os] = nil set :os, :family => 'amazon', :release => '2' describe get_command(:enable_service, 'httpd') do it { should eq 'systemctl enable httpd' } end describe get_command(:disable_service, 'httpd') do it { should eq 'systemctl disable httpd' } end describe get_command(:start_se...
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/command/sles11/user_spec.rb
Ruby
mit
300
master
430
require 'spec_helper' property[:os] = nil set :os, :family => 'sles', :release => '11' describe get_command(:get_user_minimum_days_between_password_change, 'foo') do it { should eq "chage -l foo | sed -n 's/^Minimum://p' | sed 's|^[[:blank:]]*||g'" } end describe get_command(:get_user_maximum_days_between_password...
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/command/openbsd/service_spec.rb
Ruby
mit
300
master
290
require 'spec_helper' property[:os] = nil set :os, :family => 'openbsd' describe get_command(:check_service_is_enabled, 'httpd') do it { should eq '/etc/rc.d/httpd status' } end describe get_command(:check_service_is_running, 'httpd') do it { should eq '/etc/rc.d/httpd check' } end
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/command/openbsd/port_spec.rb
Ruby
mit
300
master
514
require 'spec_helper' property[:os] = nil set :os, :family => 'openbsd' describe get_command(:check_port_is_listening, '80') do it { should eq "netstat -nat -f inet | egrep '((tcp|udp).*.80.*LISTEN$)'" } end describe get_command(:check_port_is_listening, '22', :protocol => 'tcp') do it { should eq "netstat -nat ...
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/command/openbsd/host_spec.rb
Ruby
mit
300
master
855
require 'spec_helper' property[:os] = nil set :os, :family => 'openbsd' describe get_command(:check_host_is_reachable, 'pink.unicorn.com', nil, 'tcp', 10) do it { should eq "ping -w 10 -c 2 -n pink.unicorn.com"} end describe get_command(:check_host_is_reachable, 'pink.unicorn.com', 53, 'udp', 66) do it { shou...
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/command/openbsd/interface_spec.rb
Ruby
mit
300
master
1,953
require 'spec_helper' property[:os] = nil set :os, :family => 'openbsd' describe get_command(:get_interface_speed_of, 'vio0') do it { should eq "ifconfig vio0 | grep 'media\:' | perl -pe 's|.*media\:.*\\((.*?)\\)|\\1|'" } end describe get_command(:check_interface_has_ipv6_address, 'vio0', '2001:0db8:bd05:01d2:288a...
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/command/openbsd/file_spec.rb
Ruby
mit
300
master
254
require 'spec_helper' property[:os] = nil set :os, :family => 'openbsd' describe get_command(:get_file_mtime, '/tmp') do it { should eq 'stat -f %m /tmp' } end describe get_command(:get_file_size, '/tmp') do it { should eq 'stat -f %z /tmp' } end
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/command/openbsd/mail_alias_spec.rb
Ruby
mit
300
master
637
require 'spec_helper' set :os, { :family => 'openbsd' } describe get_command(:check_mail_alias_is_aliased_to, 'pink', '|/pony') do it do should eq %Q{egrep ^pink:.*\\(\\[\\[:space:\\]\\]\\|,\\)\\[\\\"\\'\\]\\?} + %Q{\\\\\\|/pony\\[\\\"\\'\\]\\?\\(,\\|\\$\\) } + %Q{/etc/mail/aliases} ...
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/command/voidlinux/package_spec.rb
Ruby
mit
300
master
220
require 'spec_helper' require 'spec_helper' set :os, { :family => 'voidlinux' } describe get_command(:check_package_is_installed, 'httpd') do it { should eq "xbps-query -S httpd | grep -q 'state: installed'" } end
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/command/voidlinux/service_spec.rb
Ruby
mit
300
master
592
require 'spec_helper' property[:os] = nil set :os, :family => 'voidlinux' describe get_command(:enable_service, 'nginx') do it { should eq 'ln -s /etc/sv/nginx /var/service/' } end describe get_command(:disable_service, 'nginx') do it { should eq 'rm /var/service/nginx' } end describe get_command(:start_service...
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/command/linux/bond_spec.rb
Ruby
mit
300
master
315
require 'spec_helper' property[:os] = nil set :os, :family => 'linux' describe get_command(:check_bond_exists, 'bond0') do it { should eq "ip link show bond0" } end describe get_command(:check_bond_has_interface, 'br0', 'eth0') do it { should eq "grep -o 'Slave Interface: eth0' /proc/net/bonding/br0" } end
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/command/linux/selinux_module_spec.rb
Ruby
mit
300
master
370
require 'spec_helper' property[:os] = nil set :os, :family => 'linux' describe get_command(:check_selinux_module_is_installed, 'dnsmasq') do it { should eq "semodule -l | grep $'^dnsmasq\\t'" } end describe get_command(:check_selinux_module_is_enabled, 'dnsmasq') do it { should eq "semodule -l | grep $'^dnsmasq\...
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/command/linux/file_spec.rb
Ruby
mit
300
master
348
require 'spec_helper' property[:os] = nil set :os, :family => 'linux' describe get_command(:check_file_is_immutable, 'some_file') do it { should eq "lsattr -d some_file 2>&1 | awk '$1~/^[A-Za-z-]+$/ && $1~/i/ {exit 0} {exit 1}'" } end describe get_command(:get_file_selinuxlabel, 'some_file') do it { should eq '...
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/command/linux/selinux_spec.rb
Ruby
mit
300
master
954
require 'spec_helper' property[:os] = nil set :os, :family => 'linux' describe get_command(:check_selinux_has_mode, 'disabled') do it do should eq %Q{test ! -f /etc/selinux/config || ( ( (} + %Q{getenforce | grep -i -- disabled) ||} + %Q{ (getenforce | grep -i -- permissive) )} + ...
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/command/linux/inventory_spec.rb
Ruby
mit
300
master
591
require 'spec_helper' set :os, :family => 'linux' describe get_command(:get_inventory_memory) do it { should eq 'cat /proc/meminfo' } end describe get_command(:get_inventory_cpu) do it { should eq 'cat /proc/cpuinfo' } end describe get_command(:get_inventory_kernel) do it { should eq 'uname -s -r' } end desc...
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/command/linux/bridge_spec.rb
Ruby
mit
300
master
291
require 'spec_helper' property[:os] = nil set :os, :family => 'linux' describe get_command(:check_bridge_exists, 'br0') do it { should eq "ip link show br0" } end describe get_command(:check_bridge_has_interface, 'br0', 'eth0') do it { should eq "brctl show br0 | grep -o eth0" } end
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/command/linux/interface_spec.rb
Ruby
mit
300
master
1,349
require 'spec_helper' property[:os] = nil set :os, :family => 'linux' describe get_command(:check_interface_has_ipv6_address, 'eth0', '2001:0db8:bd05:01d2:288a:1fc0:0001:10ee') do it { should eq "ip -6 addr show eth0 | grep 'inet6 2001:0db8:bd05:01d2:288a:1fc0:0001:10ee/'" } end describe get_command(:check_interfa...
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/command/solaris11/user_spec.rb
Ruby
mit
300
master
430
require 'spec_helper' property[:os] = nil set :os, :family => 'solaris', :release => '11' describe get_command(:get_user_minimum_days_between_password_change, 'foo') do it { should eq "passwd -s foo | sed 's/ \\{1,\\}/%/g' | tr '%' '\n' | sed '4q;d'" } end describe get_command(:get_user_maximum_days_between_passwo...
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/command/base/user_spec.rb
Ruby
mit
300
master
2,358
require 'spec_helper' set :os, { :family => nil } describe get_command(:get_user_uid, 'foo') do it { should eq 'id -u foo' } end describe get_command(:get_user_gid, 'foo') do it { should eq 'id -g foo' } end describe get_command(:get_user_home_directory, 'foo') do it { should eq "getent passwd foo | cut -f 6 ...
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/command/base/host_spec.rb
Ruby
mit
300
master
802
require 'spec_helper' set :os, { :family => nil } describe get_command(:check_host_is_reachable, 'pink.unicorn.com', nil, 'tcp', 10) do it { should eq "ping -w 10 -c 2 -n pink.unicorn.com" } end describe get_command(:check_host_is_reachable, 'pink.unicorn.com', '53', 'udp', 2) do it { should eq "nc -w 2 -vvvv...
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/command/base/package_spec.rb
Ruby
mit
300
master
630
require 'spec_helper' set :os, { :family => nil } describe get_command(:check_package_is_installed_by_gem, 'serverspec', '2.0.0') do it { should eq 'gem list --local | grep -iw -- \\^serverspec\\ | grep -w -- "[( ]2.0.0[,)]"' } end describe get_command(:check_package_is_installed_by_td_agent_gem, 'fluent-plugin-f...
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/command/base/mail_alias_spec.rb
Ruby
mit
300
master
576
require 'spec_helper' set :os, { :family => nil } describe get_command(:check_mail_alias_is_aliased_to, 'pink', '|/pony') do it do should eq %Q{getent aliases pink | } + %Q{egrep -- \\\[\\\[:space:\\\]\\\]\\\(\\\[\\\"\\'\\\]\\?\\)\\\\\\|/pony\\\\1\\\(,\\\|\\\$\\\)} end end describe get_command(...
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/command/base/file_spec.rb
Ruby
mit
300
master
3,646
require 'spec_helper' set :os, { :family => nil } describe get_command(:check_file_is_directory, '/tmp') do it { should eq 'test -d /tmp' } end describe get_command(:check_file_is_symlink, '/tmp') do it { should eq 'test -L /tmp' } end describe get_command(:change_file_mode, '/tmp', '0644') do it { should eq ...
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/command/base/group_spec.rb
Ruby
mit
300
master
1,014
require 'spec_helper' set :os, { :family => nil } describe get_command(:get_group_gid, 'foo') do it { should eq "getent group foo | cut -f 3 -d ':'" } end describe get_command(:update_group_gid, 'foo', 1234) do it { should eq "groupmod -g 1234 foo" } end describe get_command(:add_group, 'foo', :gid => 1234) do ...
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/command/debian9/service_spec.rb
Ruby
mit
300
master
264
require 'spec_helper' property[:os] = nil set :os, :family => 'debian', :release => '9' describe get_command(:check_service_is_enabled, 'apache') do it { should eq 'systemctl --quiet is-enabled apache||ls /etc/rc[S5].d/S??apache >/dev/null 2>/dev/null' } end
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/command/debian9/port_spec.rb
Ruby
mit
300
master
200
require 'spec_helper' property[:os] = nil set :os, :family => 'debian', :release => '9' describe get_command(:check_port_is_listening, '80') do it { should eq 'ss -tunl | grep -E -- :80\ ' } end
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/command/windows/service_spec.rb
Ruby
mit
300
master
1,744
require 'spec_helper' RSpec.describe Specinfra::Command::Windows::Base::Service do before :all do property[:os] = nil set :os, :family => 'windows' end after :all do property[:os] = nil set :os, :family => nil end let(:service_name) { "Power" } let(:property_map) {{"StartName"=>"Local Sys...
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/command/windows/registry_key_spec.rb
Ruby
mit
300
master
1,195
require 'spec_helper' RSpec.describe Specinfra::Command::Windows::Base::RegistryKey do let(:key_path) { "HKLM\\Software\\Microsoft\\Windows" } def stub_exec (command) expect(described_class).to receive(:create_command).with(command) end describe 'has_property?' do it { stub_exec "(Get-Item 'Reg...
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/command/sles15/service_spec.rb
Ruby
mit
300
master
209
require 'spec_helper' property[:os] = nil set :os, :family => 'sles', :release => '15' describe get_command(:check_service_is_enabled, 'httpd') do it { should eq 'systemctl --quiet is-enabled httpd' } end
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/command/cumulus/ppa_cumuluslinux_spec.rb
Ruby
mit
300
master
241
require 'spec_helper' property[:os] = nil set :os, :family => 'cumuluslinux' describe get_command(:check_ppa_exists, 'git') do it { should eq 'find /etc/apt/ -name *.list | xargs grep -o "deb +http://repo.cumulusnetworks.com/git"' } end
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/command/cumulus/ppa_cumulusnetworks_spec.rb
Ruby
mit
300
master
244
require 'spec_helper' property[:os] = nil set :os, :family => 'cumulusnetworks' describe get_command(:check_ppa_exists, 'git') do it { should eq 'find /etc/apt/ -name *.list | xargs grep -o "deb +http://repo.cumulusnetworks.com/git"' } end
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/command/redhat8/selinux_spec.rb
Ruby
mit
300
master
343
require 'spec_helper' property[:os] = nil set :os, :family => 'redhat', :release => '8' describe get_command(:check_selinux_module_is_installed, 'dnsmasq') do it { should eq "semodule -l | grep $'^dnsmasq'" } end describe get_command(:check_selinux_module_is_enabled, 'dnsmasq') do it { should eq "semodule -l | g...
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/command/redhat8/yumrepo_spec.rb
Ruby
mit
300
master
370
require 'spec_helper' property[:os] = nil set :os, :family => 'redhat', :release => '8' describe get_command(:check_yumrepo_exists, 'epel') do it { should eq "dnf repolist all | grep -qsE \"^[\\!\\*]?epel\(\\s\|$\|\\/)\"" } end describe get_command(:check_yumrepo_is_enabled, 'epel') do it { should eq "dnf repoli...
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/command/clearlinux/package_spec.rb
Ruby
mit
300
master
417
require 'spec_helper' property[:os] = nil set :os, { :family => 'clearlinux' } describe get_command(:check_package_is_installed, 'vim') do it { should eq "swupd bundle-list --quiet | grep -w vim" } end describe get_command(:install_package, 'vim') do it { should eq "swupd bundle-add --quiet vim" } end describe...
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/helper/properties_spec.rb
Ruby
mit
300
master
219
require 'spec_helper' include Specinfra::Helper::Properties describe 'Properties Helper' do before :all do set_property :role => 'proxy' end subject { property } it { should include :role => 'proxy' } end
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/helper/set_spec.rb
Ruby
mit
300
master
476
require 'spec_helper' describe 'set method set value to Specinfra.configuration' do it 'set method handle string value correctly' do set :host, 'localhost' expect(Specinfra.configuration.host).to eq 'localhost' end it 'set method handle hash value correctly' do set :ssh_options, :password => 'passwo...
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/helper/os_spec.rb
Ruby
mit
300
master
1,623
require 'spec_helper' RSpec.describe 'os', :order => :defined do def set_stub_chain(keys, value) allow(Specinfra).to receive_message_chain([:configuration, keys].flatten).and_return(value) end describe 'no ssh connection without cache' do before do property[:os] = nil set_stub_chain(:ssh, ...
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/helper/detect_os/eos_spec.rb
Ruby
mit
300
master
1,120
require 'spec_helper' require 'specinfra/helper/detect_os/eos' describe Specinfra::Helper::DetectOs::Eos do eos = Specinfra::Helper::DetectOs::Eos.new(:exec) it 'Should return eos family and the correct version.' do allow(eos).to receive(:run_command).with('ls /etc/Eos-release') { CommandResult.new(:stdo...
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/helper/detect_os/suse_spec.rb
Ruby
mit
300
master
2,704
require 'spec_helper' require 'specinfra/helper/detect_os/suse' describe Specinfra::Helper::DetectOs::Suse do suse = Specinfra::Helper::DetectOs::Suse.new(:exec) it 'Should return opensuse 42.2 when openSUSE 42.2 is installed.' do allow(suse).to receive(:run_command) { CommandResult.new(:stdout => "NAM...
github
mizzy/specinfra
https://github.com/mizzy/specinfra
spec/helper/detect_os/freebsd_spec.rb
Ruby
mit
300
master
1,401
require 'spec_helper' require 'specinfra/helper/detect_os/freebsd' describe Specinfra::Helper::DetectOs::Freebsd do freebsd = Specinfra::Helper::DetectOs::Freebsd.new(:exec) it 'Should return freebsd 10 when FreeBSD 10.1-RELEASE is installed.' do allow(freebsd).to receive(:run_command) { CommandResult.ne...