Project: Chef InSpec (Provisioning / Security & Compliance)
File: podman_volume.md

+++ title = "podman_volume resource" draft = false gh_repo = "inspec" platform = "unix" [menu] [menu.inspec] title = "podman_volume" identifier = "inspec/resources/os/podmanvolume.md podmanvolume resource" parent = "inspec/resources/os" +++ Use the `podman_volume` Chef InSpec audit resource to test the properties of a volume on Podman. This resource is distributed with Chef InSpec and is automatically available for use. Use the `podman_volume` Chef InSpec audit resource to test the properties of a volume on Podman. ```ruby describe podmanvolume("myvolume") do it { should exist } its("name") { should eq "my_volume" } its("driver") { should eq "local" } its("mountpoint") { should eq "/var/home/core/.local/share/containers/storage/volumes/myvolume/data" } its("created_at") { should eq "2022-07-14T13:21:19.965421792+05:30" } end ``` where: `'name'`, `'driver'`, `'mountpoint'`, and `'created_at'` are properties of this resource to fetch the respective value of the podman volume. `exist` is a matcher of this resource. Properties of the resources: `name`, `driver`, `mountpoint`, `createdat`, `labels`, `scope`, `options`, `mountcount`, `needscopyup`, and `needs_chown`. The `name` property returns the name of the volume. ```ruby its("name") { should eq "my_volume" } ``` The `driver` property returns the value for the volume's driver environment. ```ruby its("driver") { should eq "local" } ``` The `mountpoint` property returns the value for the volume's mount path. ```ruby its("mountpoint") { should eq "/var/home/core/.local/share/containers/storage/volumes/myvolume/data" } ``` The `created_at` property returns the creation date of the volume. ```ruby its("created_at") { should eq "2022-07-14T13:21:19.965421792+05:30" } ``` The `labels` property returns the labels associated with the volume. ```ruby its("labels") { should eq({}) } ``` The `scope` property returns the scope of the volume. ```ruby its("scope") { should eq "local" } ``` The `options` property returns the options associated with the volume. ```ruby its("options") { should eq({}) } ``` The `mount_count` property returns the MountCount value from the volume's inspect information. ```ruby its("mount_count") { should eq 0 } ``` The `needscopyup` property returns the NeedsCopyUp value from the volume's inspect information. ```ruby its("needscopyup") { should eq true } ``` The `needs_chown` property returns the NeedsChown value from the volume's inspect information. ```ruby its("needs_chown") { should eq true } ``` {{< readfile file="content/inspec/reusable/md/inspecmatcherslink.md" >}} This resource has the following special matchers. The `exist` matcher tests if the volume is available on Podman. ```ruby it { should exist } ``` ```ruby describe podmanvolume("myvolume") do it { should exist } its("name") { should eq "my_volume" } its("driver") { should eq "local" } its("mountpoint") { should eq "/var/home/core/.local/share/containers/storage/volumes/myvolume/data" } its("created_at") { should eq "2022-07-14T13:21:19.965421792+05:30" } its("labels") { should eq({}) } its("scope") { should eq "local" } its("options") { should eq({}) } its("mount_count") { should eq 0 } its("needscopyup") { should eq true } its("needs_chown") { should eq true } end ```