summaryrefslogtreecommitdiffstats
path: root/test/ral/providers/mount/netinfo.rb
blob: 7a9703c1b3ff8bdb95b5447ae4543aa0aeb952e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/usr/bin/env ruby
#
#  Created by Luke Kanies on 2006-11-12.
#  Copyright (c) 2006. All rights reserved.

require File.dirname(__FILE__) + '/../../../lib/puppettest'

require 'puppettest'
# 
# if Puppet::Type.type(:mount).provider(:netinfo).suitable?
# class TestNetinfoMountProvider < Test::Unit::TestCase
#   include PuppetTest
#
#   def setup
#       super
#       @mount = Puppet::Type.type(:mount)
#     end
#     
#     if Process.uid == 0 and Facter.value(:hostname) == "midden"
#     def test_mount_nfs
#         culain = nil
#         assert_nothing_raised do
#             culain = @mount.create :name => "/mnt", :device => "culain:/home/luke", :options => "-o -P", :ensure => :present,
#                 :fstype => "nfs"
#         end
#         
#         assert(culain, "Did not create fs")
#         
#         assert_apply(culain)
# 
#         assert_nothing_raised do
#             culain.provider.mount
#         end
#         
#         assert(culain.provider.mounted?, "fs is not considered mounted")
#         assert_nothing_raised() { culain.provider.unmount }
#         
#         culain[:ensure] = :absent
#         
#         assert_apply(culain)
#     end
#     end
#     
#     def test_simple
#         root = nil
#         assert_nothing_raised do
#             root = @mount.create :name => "/", :check => @mount.validproperties
#         end
#         
#         assert_nothing_raised do
#             root.retrieve
#         end
#         
#         prov = root.provider
#         
#         assert_nothing_raised do
#             assert(prov.device, "Did not value for device")
#             assert(prov.device != :absent, "Netinfo thinks the root device is missing")
#         end
#     end
#
#   def test_list
#       list = nil
#       assert_nothing_raised do
#           list = @mount.list
#         end
#         assert(list.length > 0)
#         list.each do |obj|
#             assert_instance_of(@mount, obj)
#             assert(obj[:name], "objects do not have names")
#             p obj
#             assert(obj.is(:device), "Did not get value for device in %s" % obj[:name])
#         end
#         
#         assert(list.detect { |m| m[:name] == "/"}, "Could not find root fs")
#     end
# end
# end