def test_ap_missing_psk(dev, apdev):
    'WPA2-PSK AP and no PSK configured'
    ssid = 'test-wpa2-psk'
    params = hostapd.wpa2_params(ssid=ssid)
    try:
        hostapd.add_ap(apdev[0], params)
        raise Exception('AP setup succeeded unexpectedly')
    except Exception as e:
        if ('Failed to enable hostapd' in str(e)):
            pass
        else:
            raise
WPA2-PSK AP and no PSK configured
def test_ap_missing_psk(dev, apdev):
    
    ssid = 'test-wpa2-psk'
    params = hostapd.wpa2_params(ssid=ssid)
    try:
        hostapd.add_ap(apdev[0], params)
        raise Exception('AP setup succeeded unexpectedly')
    except Exception as e:
        if ('Failed to enable hostapd' in str(e)):
            pass
        else:
            raise