You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
✖ basic-1: /etc should be a directory (expected File /etc.directory? to return true, got false)
Summary: 0 successful, 1 failures, 0 skipped
ran docker command to make sure dir exists
~/development/mydev> docker exec -ti 6811e2e6ef1f ls -l /etc/
total 216
-rw-r--r-- 1 root root 4 Jun 17 16:39 TZ
-rw-r--r-- 1 root root 6 May 31 14:20 alpine-release
.
.
The text was updated successfully, but these errors were encountered:
➜ inspec git:(master) ✗ bundle exec inspec shell -t docker://2264e35f2a1b
Welcome to the interactive InSpec Shell
To find out how to use it, type: help
inspec> help
Available commands:
`[resource]` - run resource on target machine
`help resources` - show all available resources that can be used as commands
`help [resource]` - information about a specific resource
`exit` - exit the InSpec shell
You can use resources in this environment to test the target machine. For example:
command('uname -a').stdout
file('/proc/cpuinfo').content => "value",
You are currently running on:
OS platform: alpine
OS family: alpine
OS release: 3.4.0
inspec> file('/etc').directory?
=> true
inspec>
I am newbie to inspec...need help.
Testing for InSpec audit resource to test if the file type is a directory and it fails. Tried both file and directory resource.
InSpec and Platform Version
inspec (0.32.0) on Mac testing docker container
docker version
Client:
Version: 1.12.0
API version: 1.24
Go version: go1.6.3
Git commit: 8eab29e
Built: Thu Jul 28 21:15:28 2016
OS/Arch: darwin/amd64
Server:
Version: 1.12.0
API version: 1.24
Go version: go1.6.3
Git commit: 8eab29e
Built: Thu Jul 28 21:15:28 2016
OS/Arch: linux/amd64
Tell us which version of InSpec (
inspec version
or SHA of a commit) and Operating System distribution you are using0.32.0
Here is the control.
control 'basic-1' do
impact 1.0
title '/etc should be a directory'
describe file('/etc') do
it { should be_directory }
end
end
and failed test o/p.
inspec exec inspec/etc.rb -t docker://6811e2e6ef1f
Target: docker://6811e2e6ef1f4b4642da9610cdba1b0a899d85de82a9d25c85376d141a4cd64a
✖ basic-1: /etc should be a directory (expected
File /etc.directory?
to return true, got false)Summary: 0 successful, 1 failures, 0 skipped
ran docker command to make sure dir exists
~/development/mydev> docker exec -ti 6811e2e6ef1f ls -l /etc/
total 216
-rw-r--r-- 1 root root 4 Jun 17 16:39 TZ
-rw-r--r-- 1 root root 6 May 31 14:20 alpine-release
.
.
The text was updated successfully, but these errors were encountered: