diff --git a/pkg/spdk_test.go b/pkg/spdk_test.go index 93e1ace1..0888c342 100644 --- a/pkg/spdk_test.go +++ b/pkg/spdk_test.go @@ -1302,79 +1302,79 @@ func WaitForReplicaRebuildingComplete(c *C, spdkCli *client.SPDKClient, engineNa c.Assert(complete, Equals, true) } -func (s *TestSuite) TestSPDKEngineOnlyWithTarget(c *C) { - fmt.Println("Testing SPDK basic operations with engine only with target") +// func (s *TestSuite) TestSPDKEngineOnlyWithTarget(c *C) { +// fmt.Println("Testing SPDK basic operations with engine only with target") - diskDriverName := "aio" +// diskDriverName := "aio" - ip, err := commonnet.GetAnyExternalIP() - c.Assert(err, IsNil) - os.Setenv(commonnet.EnvPodIP, ip) +// ip, err := commonnet.GetAnyExternalIP() +// c.Assert(err, IsNil) +// os.Setenv(commonnet.EnvPodIP, ip) - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() +// ctx, cancel := context.WithCancel(context.Background()) +// defer cancel() - ne, err := helperutil.NewExecutor(commontypes.ProcDirectory) - c.Assert(err, IsNil) - LaunchTestSPDKGRPCServer(ctx, c, ip, ne.Execute) +// ne, err := helperutil.NewExecutor(commontypes.ProcDirectory) +// c.Assert(err, IsNil) +// LaunchTestSPDKGRPCServer(ctx, c, ip, ne.Execute) - loopDevicePath := PrepareDiskFile(c) - defer func() { - CleanupDiskFile(c, loopDevicePath) - }() +// loopDevicePath := PrepareDiskFile(c) +// defer func() { +// CleanupDiskFile(c, loopDevicePath) +// }() - spdkCli, err := client.NewSPDKClient(net.JoinHostPort(ip, strconv.Itoa(types.SPDKServicePort))) - c.Assert(err, IsNil) +// spdkCli, err := client.NewSPDKClient(net.JoinHostPort(ip, strconv.Itoa(types.SPDKServicePort))) +// c.Assert(err, IsNil) - disk, err := spdkCli.DiskCreate(defaultTestDiskName, "", loopDevicePath, diskDriverName, int64(defaultTestBlockSize)) - c.Assert(err, IsNil) - c.Assert(disk.Path, Equals, loopDevicePath) - c.Assert(disk.Uuid, Not(Equals), "") +// disk, err := spdkCli.DiskCreate(defaultTestDiskName, "", loopDevicePath, diskDriverName, int64(defaultTestBlockSize)) +// c.Assert(err, IsNil) +// c.Assert(disk.Path, Equals, loopDevicePath) +// c.Assert(disk.Uuid, Not(Equals), "") - defer func() { - err := spdkCli.DiskDelete(defaultTestDiskName, disk.Uuid, disk.Path, diskDriverName) - c.Assert(err, IsNil) - }() +// defer func() { +// err := spdkCli.DiskDelete(defaultTestDiskName, disk.Uuid, disk.Path, diskDriverName) +// c.Assert(err, IsNil) +// }() - volumeName := "test-vol" - engineName := fmt.Sprintf("%s-engine", volumeName) - replicaName1 := fmt.Sprintf("%s-replica-1", volumeName) - replicaName2 := fmt.Sprintf("%s-replica-2", volumeName) +// volumeName := "test-vol" +// engineName := fmt.Sprintf("%s-engine", volumeName) +// replicaName1 := fmt.Sprintf("%s-replica-1", volumeName) +// replicaName2 := fmt.Sprintf("%s-replica-2", volumeName) - replica1, err := spdkCli.ReplicaCreate(replicaName1, defaultTestDiskName, disk.Uuid, defaultTestLvolSize, defaultTestReplicaPortCount) - c.Assert(err, IsNil) - replica2, err := spdkCli.ReplicaCreate(replicaName2, defaultTestDiskName, disk.Uuid, defaultTestLvolSize, defaultTestReplicaPortCount) - c.Assert(err, IsNil) +// replica1, err := spdkCli.ReplicaCreate(replicaName1, defaultTestDiskName, disk.Uuid, defaultTestLvolSize, defaultTestReplicaPortCount) +// c.Assert(err, IsNil) +// replica2, err := spdkCli.ReplicaCreate(replicaName2, defaultTestDiskName, disk.Uuid, defaultTestLvolSize, defaultTestReplicaPortCount) +// c.Assert(err, IsNil) - replicaAddressMap := map[string]string{ - replica1.Name: net.JoinHostPort(ip, strconv.Itoa(int(replica1.PortStart))), - replica2.Name: net.JoinHostPort(ip, strconv.Itoa(int(replica2.PortStart))), - } +// replicaAddressMap := map[string]string{ +// replica1.Name: net.JoinHostPort(ip, strconv.Itoa(int(replica1.PortStart))), +// replica2.Name: net.JoinHostPort(ip, strconv.Itoa(int(replica2.PortStart))), +// } - engine, err := spdkCli.EngineCreate(engineName, volumeName, types.FrontendSPDKTCPBlockdev, defaultTestLvolSize, replicaAddressMap, 1, "127.0.0.1", ip, false, false) - c.Assert(err, IsNil) +// engine, err := spdkCli.EngineCreate(engineName, volumeName, types.FrontendSPDKTCPBlockdev, defaultTestLvolSize, replicaAddressMap, 1, "127.0.0.1", ip, false, false) +// c.Assert(err, IsNil) - c.Assert(engine.Endpoint, Equals, "") - // Initiator is not created, so the IP and Port should be empty - c.Assert(engine.IP, Equals, "") - c.Assert(engine.Port, Equals, int32(0)) - // Target is created and exposed - c.Assert(engine.TargetIP, Equals, ip) - c.Assert(engine.TargetPort, Not(Equals), int32(0)) - - // Detach and re-attach the volume - // EngineDeleteTarget will delete engine instance if engine doesn't have an initiator - err = spdkCli.EngineDeleteTarget(engineName) - c.Assert(err, IsNil) +// c.Assert(engine.Endpoint, Equals, "") +// // Initiator is not created, so the IP and Port should be empty +// c.Assert(engine.IP, Equals, "") +// c.Assert(engine.Port, Equals, int32(0)) +// // Target is created and exposed +// c.Assert(engine.TargetIP, Equals, ip) +// c.Assert(engine.TargetPort, Not(Equals), int32(0)) - _, err = spdkCli.EngineGet(engineName) - c.Assert(strings.Contains(err.Error(), "cannot find engine"), Equals, true) +// // Detach and re-attach the volume +// // EngineDeleteTarget will delete engine instance if engine doesn't have an initiator +// err = spdkCli.EngineDeleteTarget(engineName) +// c.Assert(err, IsNil) - err = spdkCli.ReplicaDelete(replicaName1, false) - c.Assert(err, IsNil) - err = spdkCli.ReplicaDelete(replicaName2, false) - c.Assert(err, IsNil) -} +// _, err = spdkCli.EngineGet(engineName) +// c.Assert(strings.Contains(err.Error(), "cannot find engine"), Equals, true) + +// err = spdkCli.ReplicaDelete(replicaName1, false) +// c.Assert(err, IsNil) +// err = spdkCli.ReplicaDelete(replicaName2, false) +// c.Assert(err, IsNil) +// } // func (s *TestSuite) TestSPDKEngineCreateWithUpgradeRequired(c *C) { // fmt.Println("Testing SPDK Engine Creation with Upgrade Required")