Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
--- /dev/null 2008-04-22 11:09:08.144010296 -0700 +++ ./selinux.rb 2008-05-07 10:02:28.000000000 -0700 @@ -0,0 +1,69 @@ +#!/usr/bin/env ruby + +require File.dirname(__FILE__) + '/../lib/puppettest' + +require 'puppet' +require 'puppettest' + +class TestSELinux < Test::Unit::TestCase + include PuppetTest + + def test_filecontext + path = tempfile() + file = nil + context = nil + + file = Puppet.type(:file).create( + :path => path, + :ensure => "file" + ) + + assert_nothing_raised() { + file[:seluser] = "foo_u" + } + assert_nothing_raised() { + file[:selrole] = "bar_r" + } + assert_nothing_raised() { + file[:seltype] = "baz_t" + } + end + + def test_seboolean + bool = nil + assert( + bool = Puppet::Type.type(:selboolean) + ) + assert( + bool = { + :name => 'foo', + :value => 'off', + :persistent => true + } + ) + assert( + bool = { + :name => 'bar', + :value => 'on', + :persistent => false + } + ) + end + + def test_semodule + mod = nil + assert( + mod = Puppet::Type.type(:selmodule).create( + :name => 'foo', + :selmoduledir => '/some/path/here', + :selmodulepath => '/some/path/here/foo.pp', + :syncversion => 'true' + ) + ) + + assert(mod[:name] = 'bar') + assert(mod[:selmoduledir] = '/some/other/path') + assert(mod[:selmodulepath] = '/some/other/path/bar.pp') + assert(mod[:syncversion] = 'false') #XXX: Bug here. False is not a valid value. + end +end
This paste will be private.
From the Design Piracy series on my blog: