@@ -125,6 +125,43 @@ func TestAccLibvirtVolume_Basic(t *testing.T) {
125
125
})
126
126
}
127
127
128
+ func TestAccLibvirtVolume_SizeRound (t * testing.T ) {
129
+ var volume libvirt.StorageVol
130
+ randomVolumeResource := acctest .RandStringFromCharSet (10 , acctest .CharSetAlpha )
131
+ randomVolumeName := acctest .RandStringFromCharSet (10 , acctest .CharSetAlpha )
132
+ randomPoolName := acctest .RandStringFromCharSet (10 , acctest .CharSetAlpha )
133
+ randomPoolPath := "/tmp/terraform-provider-libvirt-pool-" + randomPoolName
134
+ resource .Test (t , resource.TestCase {
135
+ PreCheck : func () { testAccPreCheck (t ) },
136
+ Providers : testAccProviders ,
137
+ CheckDestroy : testAccCheckLibvirtVolumeDestroy ,
138
+ Steps : []resource.TestStep {
139
+ {
140
+ Config : fmt .Sprintf (`
141
+ resource "libvirt_pool" "%s" {
142
+ name = "%s"
143
+ type = "dir"
144
+ path = "%s"
145
+ }
146
+
147
+ resource "libvirt_volume" "%s" {
148
+ name = "%s"
149
+ size = 1073741823
150
+ pool = "${libvirt_pool.%s.name}"
151
+ }` , randomPoolName , randomPoolName , randomPoolPath , randomVolumeResource , randomVolumeName , randomPoolName ),
152
+ Check : resource .ComposeTestCheckFunc (
153
+ testAccCheckLibvirtVolumeExists ("libvirt_volume." + randomVolumeResource , & volume ),
154
+ resource .TestCheckResourceAttr (
155
+ "libvirt_volume." + randomVolumeResource , "name" , randomVolumeName ),
156
+ resource .TestCheckResourceAttr (
157
+ "libvirt_volume." + randomVolumeResource , "size" , "1073741824" ),
158
+ ),
159
+ },
160
+ },
161
+ })
162
+ }
163
+
164
+
128
165
func TestAccLibvirtVolume_BackingStoreTestByID (t * testing.T ) {
129
166
var volume libvirt.StorageVol
130
167
random := acctest .RandStringFromCharSet (10 , acctest .CharSetAlpha )
0 commit comments