@@ -119,7 +119,7 @@ func TestShimExitsUponContainerDelete_Isolated(t *testing.T) {
119
119
require .NoError (t , err , "unable to create client to containerd service at %s, is containerd running?" , containerdSockPath )
120
120
defer client .Close ()
121
121
122
- image , err := alpineImage (ctx , client , defaultSnapshotterName () )
122
+ image , err := alpineImage (ctx , client , defaultSnapshotterName )
123
123
require .NoError (t , err , "failed to get alpine image" )
124
124
125
125
testTimeout := 60 * time .Second
@@ -131,7 +131,7 @@ func TestShimExitsUponContainerDelete_Isolated(t *testing.T) {
131
131
container , err := client .NewContainer (testCtx ,
132
132
containerName ,
133
133
containerd .WithRuntime (firecrackerRuntime , nil ),
134
- containerd .WithSnapshotter (defaultSnapshotterName () ),
134
+ containerd .WithSnapshotter (defaultSnapshotterName ),
135
135
containerd .WithNewSnapshot (snapshotName , image ),
136
136
containerd .WithNewSpec (
137
137
oci .WithProcessArgs ("sleep" , fmt .Sprintf ("%d" , testTimeout / time .Second )),
@@ -143,7 +143,7 @@ func TestShimExitsUponContainerDelete_Isolated(t *testing.T) {
143
143
_ , err = client .NewContainer (testCtx ,
144
144
fmt .Sprintf ("should-fail-%s-%d" , t .Name (), time .Now ().UnixNano ()),
145
145
containerd .WithRuntime (firecrackerRuntime , nil ),
146
- containerd .WithSnapshotter (defaultSnapshotterName () ),
146
+ containerd .WithSnapshotter (defaultSnapshotterName ),
147
147
containerd .WithNewSnapshot (snapshotName , image ),
148
148
containerd .WithNewSpec (
149
149
oci .WithProcessArgs ("sleep" , fmt .Sprintf ("%d" , testTimeout / time .Second )),
@@ -316,7 +316,7 @@ func (runner *testMultipleVMsRunner) TestMultipleVMs(t *testing.T) {
316
316
require .NoError (t , err , "unable to create client to containerd service at %s, is containerd running?" , containerdSockPath )
317
317
defer client .Close ()
318
318
319
- image , err := alpineImage (ctx , client , defaultSnapshotterName () )
319
+ image , err := alpineImage (ctx , client , defaultSnapshotterName )
320
320
require .NoError (t , err , "failed to get alpine image" )
321
321
322
322
pluginClient , err := ttrpcutil .NewClient (containerdSockPath + ".ttrpc" )
@@ -446,7 +446,7 @@ func (runner *testMultipleVMsRunner) testMultipleExecs(
446
446
// spawn a container that just prints the VM's eth0 mac address (which we have set uniquely per VM)
447
447
newContainer , err := client .NewContainer (ctx ,
448
448
containerName ,
449
- containerd .WithSnapshotter (defaultSnapshotterName () ),
449
+ containerd .WithSnapshotter (defaultSnapshotterName ),
450
450
containerd .WithNewSnapshot (snapshotName , image ),
451
451
containerd .WithNewSpec (
452
452
processArgs ,
@@ -646,7 +646,7 @@ func TestStubBlockDevices_Isolated(t *testing.T) {
646
646
require .NoError (t , err , "unable to create client to containerd service at %s, is containerd running?" , containerdSockPath )
647
647
defer client .Close ()
648
648
649
- image , err := alpineImage (ctx , client , defaultSnapshotterName () )
649
+ image , err := alpineImage (ctx , client , defaultSnapshotterName )
650
650
require .NoError (t , err , "failed to get alpine image" )
651
651
652
652
tapName := fmt .Sprintf ("tap%d" , vmID )
@@ -677,7 +677,7 @@ func TestStubBlockDevices_Isolated(t *testing.T) {
677
677
678
678
newContainer , err := client .NewContainer (ctx ,
679
679
containerName ,
680
- containerd .WithSnapshotter (defaultSnapshotterName () ),
680
+ containerd .WithSnapshotter (defaultSnapshotterName ),
681
681
containerd .WithNewSnapshot (snapshotName , image ),
682
682
containerd .WithNewSpec (
683
683
firecrackeroci .WithVMID (strconv .Itoa (vmID )),
@@ -808,7 +808,7 @@ func testCreateContainerWithSameName(t *testing.T, vmID string) {
808
808
require .NoError (t , err , "unable to create client to containerd service at %s, is containerd running?" , containerdSockPath )
809
809
defer client .Close ()
810
810
811
- image , err := alpineImage (ctx , client , defaultSnapshotterName () )
811
+ image , err := alpineImage (ctx , client , defaultSnapshotterName )
812
812
require .NoError (t , err , "failed to get alpine image" )
813
813
814
814
containerName := fmt .Sprintf ("%s-%d" , t .Name (), time .Now ().UnixNano ())
@@ -818,7 +818,7 @@ func testCreateContainerWithSameName(t *testing.T, vmID string) {
818
818
819
819
c1 , err := client .NewContainer (ctx ,
820
820
containerName ,
821
- containerd .WithSnapshotter (defaultSnapshotterName () ),
821
+ containerd .WithSnapshotter (defaultSnapshotterName ),
822
822
containerd .WithNewSnapshot (snapshotName , image ),
823
823
withNewSpec ,
824
824
)
@@ -844,7 +844,7 @@ func testCreateContainerWithSameName(t *testing.T, vmID string) {
844
844
// So, we can launch a new container with the same name
845
845
c2 , err := client .NewContainer (ctx ,
846
846
containerName ,
847
- containerd .WithSnapshotter (defaultSnapshotterName () ),
847
+ containerd .WithSnapshotter (defaultSnapshotterName ),
848
848
containerd .WithNewSnapshot (snapshotName , image ),
849
849
withNewSpec ,
850
850
)
@@ -884,14 +884,14 @@ func TestStubDriveReserveAndReleaseByContainers_Isolated(t *testing.T) {
884
884
require .NoError (t , err , "unable to create client to containerd service at %s, is containerd running?" , containerdSockPath )
885
885
defer client .Close ()
886
886
887
- image , err := alpineImage (ctx , client , defaultSnapshotterName () )
887
+ image , err := alpineImage (ctx , client , defaultSnapshotterName )
888
888
require .NoError (t , err , "failed to get alpine image" )
889
889
890
890
runEchoHello := containerd .WithNewSpec (oci .WithProcessArgs ("echo" , "-n" , "hello" ), firecrackeroci .WithVMID ("reuse-same-vm" ), oci .WithDefaultPathEnv )
891
891
892
892
c1 , err := client .NewContainer (ctx ,
893
893
"c1" ,
894
- containerd .WithSnapshotter (defaultSnapshotterName () ),
894
+ containerd .WithSnapshotter (defaultSnapshotterName ),
895
895
containerd .WithNewSnapshot ("c1" , image ),
896
896
runEchoHello ,
897
897
)
@@ -905,7 +905,7 @@ func TestStubDriveReserveAndReleaseByContainers_Isolated(t *testing.T) {
905
905
906
906
c2 , err := client .NewContainer (ctx ,
907
907
"c2" ,
908
- containerd .WithSnapshotter (defaultSnapshotterName () ),
908
+ containerd .WithSnapshotter (defaultSnapshotterName ),
909
909
containerd .WithNewSnapshot ("c2" , image ),
910
910
runEchoHello ,
911
911
)
@@ -936,7 +936,7 @@ func TestDriveMount_Isolated(t *testing.T) {
936
936
fcClient , err := fcClient .New (containerdSockPath + ".ttrpc" )
937
937
require .NoError (t , err , "failed to create fccontrol client" )
938
938
939
- image , err := alpineImage (ctx , ctrdClient , defaultSnapshotterName () )
939
+ image , err := alpineImage (ctx , ctrdClient , defaultSnapshotterName )
940
940
require .NoError (t , err , "failed to get alpine image" )
941
941
942
942
vmID := "test-drive-mount"
@@ -1041,7 +1041,7 @@ func TestDriveMount_Isolated(t *testing.T) {
1041
1041
1042
1042
newContainer , err := ctrdClient .NewContainer (ctx ,
1043
1043
containerName ,
1044
- containerd .WithSnapshotter (defaultSnapshotterName () ),
1044
+ containerd .WithSnapshotter (defaultSnapshotterName ),
1045
1045
containerd .WithNewSnapshot (snapshotName , image ),
1046
1046
containerd .WithNewSpec (
1047
1047
oci .WithProcessArgs ("/bin/sh" , "-c" , strings .Join (append (ctrCommands ,
@@ -1211,13 +1211,13 @@ func TestUpdateVMMetadata_Isolated(t *testing.T) {
1211
1211
assert .Equal (t , expected , resp .Metadata )
1212
1212
1213
1213
// Check inside the vm
1214
- image , err := alpineImage (ctx , client , defaultSnapshotterName () )
1214
+ image , err := alpineImage (ctx , client , defaultSnapshotterName )
1215
1215
require .NoError (t , err , "failed to get alpine image" )
1216
1216
containerName := "mmds-test"
1217
1217
1218
1218
newContainer , err := client .NewContainer (ctx ,
1219
1219
containerName ,
1220
- containerd .WithSnapshotter (defaultSnapshotterName () ),
1220
+ containerd .WithSnapshotter (defaultSnapshotterName ),
1221
1221
containerd .WithNewSnapshot ("mmds-test-all" , image ),
1222
1222
containerd .WithNewSpec (
1223
1223
oci .WithProcessArgs ("/usr/bin/wget" ,
@@ -1237,7 +1237,7 @@ func TestUpdateVMMetadata_Isolated(t *testing.T) {
1237
1237
containerName += "-entry"
1238
1238
newContainer , err = client .NewContainer (ctx ,
1239
1239
containerName ,
1240
- containerd .WithSnapshotter (defaultSnapshotterName () ),
1240
+ containerd .WithSnapshotter (defaultSnapshotterName ),
1241
1241
containerd .WithNewSnapshot ("mmds-test-entry" , image ),
1242
1242
containerd .WithNewSpec (
1243
1243
oci .WithProcessArgs ("/usr/bin/wget" ,
@@ -1277,14 +1277,14 @@ func TestRandomness_Isolated(t *testing.T) {
1277
1277
require .NoError (t , err , "unable to create client to containerd service at %s, is containerd running?" , containerdSockPath )
1278
1278
defer client .Close ()
1279
1279
1280
- image , err := alpineImage (ctx , client , defaultSnapshotterName () )
1280
+ image , err := alpineImage (ctx , client , defaultSnapshotterName )
1281
1281
require .NoError (t , err , "failed to get alpine image" )
1282
1282
containerName := "test-entropy"
1283
1283
1284
1284
const blockCount = 1024
1285
1285
ddContainer , err := client .NewContainer (ctx ,
1286
1286
containerName ,
1287
- containerd .WithSnapshotter (defaultSnapshotterName () ),
1287
+ containerd .WithSnapshotter (defaultSnapshotterName ),
1288
1288
containerd .WithNewSnapshot ("test-entropy-snapshot" , image ),
1289
1289
containerd .WithNewSpec (
1290
1290
oci .WithDefaultUnixDevices ,
@@ -1412,7 +1412,7 @@ func TestStopVM_Isolated(t *testing.T) {
1412
1412
1413
1413
ctx := namespaces .WithNamespace (context .Background (), "default" )
1414
1414
1415
- image , err := alpineImage (ctx , client , defaultSnapshotterName () )
1415
+ image , err := alpineImage (ctx , client , defaultSnapshotterName )
1416
1416
require .NoError (err , "failed to get alpine image" )
1417
1417
1418
1418
pluginClient , err := ttrpcutil .NewClient (containerdSockPath + ".ttrpc" )
@@ -1530,7 +1530,7 @@ func TestStopVM_Isolated(t *testing.T) {
1530
1530
1531
1531
c , err := client .NewContainer (ctx ,
1532
1532
"container-" + vmID ,
1533
- containerd .WithSnapshotter (defaultSnapshotterName () ),
1533
+ containerd .WithSnapshotter (defaultSnapshotterName ),
1534
1534
containerd .WithNewSnapshot ("snapshot-" + vmID , image ),
1535
1535
containerd .WithNewSpec (oci .WithProcessArgs ("/bin/echo" , "-n" , "hello" ), firecrackeroci .WithVMID (vmID )),
1536
1536
)
@@ -1604,7 +1604,7 @@ func TestEvents_Isolated(t *testing.T) {
1604
1604
defer subscribeCancel ()
1605
1605
eventCh , errCh := client .Subscribe (subscribeCtx , "topic" )
1606
1606
1607
- image , err := alpineImage (ctx , client , defaultSnapshotterName () )
1607
+ image , err := alpineImage (ctx , client , defaultSnapshotterName )
1608
1608
require .NoError (err , "failed to get alpine image" )
1609
1609
1610
1610
pluginClient , err := ttrpcutil .NewClient (containerdSockPath + ".ttrpc" )
@@ -1618,7 +1618,7 @@ func TestEvents_Isolated(t *testing.T) {
1618
1618
1619
1619
c , err := client .NewContainer (ctx ,
1620
1620
"container-" + vmID ,
1621
- containerd .WithSnapshotter (defaultSnapshotterName () ),
1621
+ containerd .WithSnapshotter (defaultSnapshotterName ),
1622
1622
containerd .WithNewSnapshot ("snapshot-" + vmID , image ),
1623
1623
containerd .WithNewSpec (oci .WithProcessArgs ("/bin/echo" , "-n" , "hello" ), firecrackeroci .WithVMID (vmID )),
1624
1624
)
0 commit comments