def be2netLoaded():
	DRIVER_NAME = 'be2net'
	DRIVER_INFO = SUSE.getDriverInfo(DRIVER_NAME)
	if( DRIVER_INFO['loaded'] ):
		return True
	return False	
##############################################################################

def driverBlackListed():
	fileOpen = "modules.txt"
	section = "/etc/modprobe.d/blacklist\n"
	content = {}
	if Core.getSection(fileOpen, section, content):
		for line in content:
			if "blacklist mei" in content[line]:
				return True
	return False

##############################################################################
# Main Program Execution
##############################################################################

DRIVER_INFO = SUSE.getDriverInfo('mei')
if( SUSE.compareKernel(SUSE.SLE11SP3) >= 0 and SUSE.compareKernel(SUSE.SLE11SP4) < 0 ):
	if ( DRIVER_INFO['loaded'] ):
		if( driverBlackListed() ):
			Core.updateStatus(Core.ERROR, "Driver is blacklisted: " + DRIVER_INFO['name'] + ", issue avoided")
		else:
			Core.updateStatus(Core.WARN, "Reboot command may shutdown server instead of rebooting")
	else:
		Core.updateStatus(Core.ERROR, "Driver not loaded: " + DRIVER_INFO['name'] + ", skipping test")
else:
	Core.updateStatus(Core.ERROR, "Outside kernel scope, skipping test")

Core.printPatternResults()