| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 | package raid_test/*	RAID TEST SCRIPT	!!!! DO NOT RUN IN PRODUCTION !!!!	ONLY RUN IN VM ENVIRONMENT*/import (	"testing"	"imuslab.com/arozos/mod/disk/raid")func TestReadRAIDInfo(t *testing.T) {	raidInfo, err := raid.GetRAIDInfo("/dev/md0")	if err != nil {		t.Errorf("Unexpected error: %v", err)		return	}	//Pretty print info for debug	raidInfo.PrettyPrintRAIDInfo()}/*func TestCreateRAIDDevice(t *testing.T) {	//Create an empty Manager	manager, _ := raid.NewRaidManager(raid.Options{})	// Make sure the sdb and sdc exists when running test case in VM	devName, _ := raid.GetNextAvailableMDDevice()	raidLevel := 1	raidDeviceIds := []string{"/dev/sdb", "/dev/sdc"}	spareDeviceIds := []string{}	//Format the drives	for _, partion := range raidDeviceIds {		fmt.Println("Wiping partition: " + partion)		err := manager.WipeDisk(partion)		if err != nil {			t.Errorf("Disk wipe error: %v", err)			return		}	}	// Call the function being tested	err := manager.CreateRAIDDevice(devName, raidLevel, raidDeviceIds, spareDeviceIds)	if err != nil {		t.Errorf("Unexpected error: %v", err)		return	}	fmt.Println("RAID array created")}*/
 |