@@ -352,6 +352,55 @@ func TestAddEBMCmd(t *testing.T) {
352352 Times (0 )
353353 },
354354 },
355+ {
356+ name : "create ebm server with public_ipxe_boot feature and ipxe-config" ,
357+ output : "json" ,
358+ expectedOutput : testutils .ReadFixture (filepath .Join (fixtureBasePath , "create_ebm_resp.json" )),
359+ args : []string {
360+ "--input" , filepath .Join (fixtureBasePath , "create_ebm_input.json" ),
361+ "--feature" , "public_ipxe_boot" ,
362+ "--ipxe-config" , "#!ipxe\n boot" ,
363+ },
364+ configureMock : func (mock * mocks.MockHostsService ) {
365+ input := expectedInput
366+ input .Features = []string {"public_ipxe_boot" }
367+ input .IPXEConfig = testutils .PtrString ("#!ipxe\n boot" )
368+ mock .EXPECT ().
369+ CreateDedicatedServers (gomock .Any (), input ).
370+ Return ([]serverscom.DedicatedServer {testDS }, nil )
371+ },
372+ },
373+ {
374+ name : "create ebm server with ipxe-config flag" ,
375+ output : "json" ,
376+ expectedOutput : testutils .ReadFixture (filepath .Join (fixtureBasePath , "create_ebm_resp.json" )),
377+ args : []string {
378+ "--input" , filepath .Join (fixtureBasePath , "create_ebm_input.json" ),
379+ "--ipxe-config" , "#!ipxe\n boot" ,
380+ },
381+ configureMock : func (mock * mocks.MockHostsService ) {
382+ input := expectedInput
383+ input .IPXEConfig = testutils .PtrString ("#!ipxe\n boot" )
384+ mock .EXPECT ().
385+ CreateDedicatedServers (gomock .Any (), input ).
386+ Return ([]serverscom.DedicatedServer {testDS }, nil )
387+ },
388+ },
389+ {
390+ name : "create ebm server with ipxe-config in input file" ,
391+ output : "json" ,
392+ expectedOutput : testutils .ReadFixture (filepath .Join (fixtureBasePath , "create_ebm_resp.json" )),
393+ args : []string {
394+ "--input" , filepath .Join (fixtureBasePath , "create_ebm_ipxe_input.json" ),
395+ },
396+ configureMock : func (mock * mocks.MockHostsService ) {
397+ input := expectedInput
398+ input .IPXEConfig = testutils .PtrString ("#!ipxe\n boot" )
399+ mock .EXPECT ().
400+ CreateDedicatedServers (gomock .Any (), input ).
401+ Return ([]serverscom.DedicatedServer {testDS }, nil )
402+ },
403+ },
355404 {
356405 name : "create ebm server with error" ,
357406 expectError : true ,
0 commit comments