Skip to content

Commit

Permalink
add testcase for inspec#1332
Browse files Browse the repository at this point in the history
Signed-off-by: Wei, He <weihe924stephen@gmail.com>
  • Loading branch information
Wing924-r committed Nov 30, 2016
1 parent 861856f commit 25dc3e0
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/unit/mock/cmd/ps-axoZ
Expand Up @@ -2,3 +2,7 @@ LABEL PID %CPU %MEM VSZ RSS TT STAT STAR
system_u:system_r:init_t:s0 5127 0.0 0.2 547208 5376 ? Ss 10:54:22 00:00:00 opscode-pgsql postgres: bifrost bifrost 127.0.0.1(43699) idle
system_u:system_r:init_t:s0 5140 1.9 11.2 2908400 215308 ? Ssl 10:54:23 00:00:05 opscode java -Xmx466M -Xms466M -XX:NewSize=32M -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -Xloggc:/var/log/opscode/opscode-solr4/gclog.log -verbose:gc -XX:+PrintHeapAtGC -XX:+PrintGCTimeStamps -XX:+PrintGCDetails -XX:+PrintGCApplicationStoppedTime -XX:+PrintGCApplicationConcurrentTime -XX:+PrintTenuringDistribution -Dsolr.data.dir=/var/opt/opscode/opscode-solr4/data -Dsolr.solr.home=/var/opt/opscode/opscode-solr4/home -Djava.io.tmpdir=/var/opt/opscode/opscode-solr4/ -server -jar /opt/opscode/embedded/service/opscode-solr4/jetty/start.jar
system_u:system_r:init_t:s0 5169 0.0 0.0 4084 536 ? S 10:54:23 00:00:00 opscode svlogd -tt /var/log/opscode/opscode-solr4
- 4589 0.0 0.0 70992 2864 ? Ss Nov 09 00:01:01 root /usr/local/apache2/bin/httpd -k start
- 11662 0.0 0.0 70992 1460 ? S Nov 28 00:00:13 httpd /usr/local/apache2/bin/httpd -k start
- 11663 0.0 0.1 874196 4792 ? Sl Nov 28 00:00:12 httpd /usr/local/apache2/bin/httpd -k start
- 11664 0.0 0.1 874156 4468 ? Sl Nov 28 00:00:11 httpd /usr/local/apache2/bin/httpd -k start
19 changes: 19 additions & 0 deletions test/unit/resources/processes_test.rb
Expand Up @@ -49,6 +49,25 @@
})
end

it 'verify long-run processes resource on linux os' do
resource = MockLoader.new(:centos6).load_resource('processes', 'httpd')
_(resource.list.length).must_equal 4
_(resource.list[0].to_h).must_equal({
label: '-',
pid: 4589,
cpu: '0.0',
mem: '0.0',
vsz: 70992,
rss: 2864,
tty: '?',
stat: 'Ss',
start: 'Nov 09',
time: '00:01:01',
user: 'root',
command: '/usr/local/apache2/bin/httpd -k start',
})
end

it 'access attributes of a process' do
resource = MockLoader.new(:centos6).load_resource('processes', 'postgres: bifrost bifrost')
process = resource.list[0]
Expand Down

0 comments on commit 25dc3e0

Please sign in to comment.