File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1027,6 +1027,27 @@ func TestBuilderPrepare_CustomDisksValidation(t *testing.T) {
10271027 }
10281028 })
10291029
1030+ t .Run ("IncompatibleSwapSizeZero" , func (t * testing.T ) {
1031+ var b Builder
1032+ config := testConfig ()
1033+ delete (config , "image" )
1034+ config ["swap_size" ] = 0
1035+ config ["disk" ] = []map [string ]any {
1036+ {"label" : "boot" , "size" : 25000 , "image" : "linode/arch" },
1037+ }
1038+ config ["config" ] = []map [string ]any {
1039+ {"label" : "my-config" },
1040+ }
1041+
1042+ _ , _ , err := b .Prepare (config )
1043+ if err == nil {
1044+ t .Fatal ("expected error with swap_size=0 and custom disks" )
1045+ }
1046+ if ! strings .Contains (err .Error (), "swap_size cannot be specified when using custom disks" ) {
1047+ t .Fatalf ("expected specific error message, got: %s" , err )
1048+ }
1049+ })
1050+
10301051 t .Run ("IncompatibleStackScriptID" , func (t * testing.T ) {
10311052 var b Builder
10321053 config := testConfig ()
You can’t perform that action at this time.
0 commit comments