Issue #5393 has been updated by derek olsen.

% Done changed from 50 to 70

Nigel.

Here are the tests I ran against the patched puppet

1. Just ensure patch doesn't break existing zone functionality
zone { "zone_base_functionality":
  create_args  => "-b",
  realhostname => "patched",
  autoboot     => "true",
  path         => "/zones/patched",
  ip           => [ "e1000g0:10.1.16.50" ],
  sysidcfg     => "sysidcfg",
  }

2.Test new dataset functionality with just 1 dataset configured
The zfs filesystem is first created with this command
/sbin/zfs create -o mountpoint=/datasets/dataset rpool/datasets/dataset

zone { "zone_single_dataset":
  create_args  => "-b",
  realhostname => "dataset",
  dataset      => [ "rpool/datasets/dataset" ],
  autoboot     => "true",
  path         => "/zones/dataset",
  ip           => [ "e1000g0:10.1.16.51" ],
  sysidcfg     => "sysidcfg",
  }

3. Test new dataset functionality with multiple configured datasets
The zfs filesystems are first created with these commands
/sbin/zfs create -o mountpoint=/datasets/dataset1 rpool/datasets/dataset1
/sbin/zfs create -o mountpoint=/datasets/dataset2 rpool/datasets/dataset2


zone { "zone_multiple_dataset":
  create_args  => "-b",
  realhostname => "datasetm",
  dataset      =>  [ 'rpool/datasets/dataset1', 'rpool/datasets/dataset2', ],
  autoboot     => "true",
  path         => "/zones/datasetm",
  ip           => [ "e1000g0:10.1.16.52" ],
  sysidcfg     => "sysidcfg",
  }

4.Test that a dataset can be removed from the zone.  Uses zone from step #3 and 
just removes datasets


zone { "zone_multiple_dataset":
  create_args  => "-b",
  realhostname => "datasetm",
  dataset      => [],
  autoboot     => "true",
  path         => "/zones/datasetm",
  ip           => [ "e1000g0:10.1.16.52" ],
  sysidcfg     => "sysidcfg",
  }

5. Test that a configuration which references a non existent zfs file system 
will fail - this should fail
zone { "dataset_doesnt_exist":
  create_args  => "-b",
  realhostname => "break1",
  dataset      => "i/dont/exist",
  autoboot     => "true",
  path         => "/zones/break1",
  ip           => [ "e1000g0:10.1.16.54" ],
  sysidcfg     => "sysidcfg",
  }

6.  Test that a dataset which is trying to use inherit to determine its mount 
point fails - this should fail
Create the required zfs filesystem with this command 
/sbin/zfs create rpool/nomountpoint

zone { "dataset_no_mountpoint":
  create_args  => "-b",
  realhostname => "break2",
  dataset      => "rpool/nomountpoint",
  autoboot     => "true",
  path         => "/zones/break2",
  ip           => [ "e1000g0:10.1.16.53" ],
  sysidcfg     => "sysidcfg",
  }


   Anyhoo I hope this is useful even though it's outside of the existing test 
suite.  I would need some guidance to get these tests converted into proper 
puppet tests.

   Thanks.  Derek.
----------------------------------------
Feature #5393: include support for adding dataset(s) to solaris zone provider
https://projects.puppetlabs.com/issues/5393

Author: derek olsen
Status: Accepted
Priority: Normal
Assignee: Nigel Kersten
Category: Solaris
Target version: Statler
Affected Puppet version: 
Keywords: solaris zone dataset
Branch: 


  We use the zone type pretty frequently and have created an define as a 
wrapper around the zone type.   Upon reviewing the define recently it's clear 
that all it really does for us is include a dataset(s) if requested.
  For example this call to the define

       zones::create { "sample":
           ip         => [ "e1000g0:10.1.16.47" ],
       zfs_parent => "localdisks/zones",
       datasets   => "localdisks/zones/datasets",
       mountpoint => "/site/sample",
       }


ends up calling the following exec

 if $datasets != "false" {
        zones::dataset { "$name":
            datasets   => "$datasets",
            mountpoint => "$mountpoint",
        } 
    }

 exec { "${datasets}/${name}":
      command => "/usr/sbin/zonecfg -z $name 'add dataset; set 
name=${datasets}/${name} ; end ; verify ; commit'",
      unless  => "/usr/sbin/zonecfg -z $name info | /usr/bin/grep -i dataset",
      require => [ Zone["$name"], Zfs["${datasets}/${name}"] ],
  }

  We would like to get rid of the define and have puppet natively support the 
ability to add an dataset to a zone configuration.
  Thanks.  Derek.


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to