{
    "name"  : "vpdn-group配置检查",
    "problems" : {
        "noVConError" : {
            "desc"      : "【问题】没配置任何vpdn-group。",
            "advice"    : "【建议】需要配置vpdn-group。"
        },
		"noDiaError" : {
            "desc"      : "【问题】vpdn-group上未配置accept-dialin。",
            "advice"    : "【建议】vpdn-group上配置accept-dialin。"
        },
		"noProError" : {
            "desc"      : "【问题】vpdn-group上未配置protocol。",
            "advice"    : "【建议】vpdn-group上配置protocol。"
        },
		"noTmpError" : {
            "desc"      : "【问题】vpdn-group上未配置virtual-template接口。",
            "advice"    : "【建议】vpdn-group上关联VT口。"
        }
    }
}
---------------------------code-------------------------------
isClient= precondition('isClient')
print isClient
if isClient == true :
	print 'skip'
	return 'skip'
end
errorFlag = 0
num = 0
res = cli("show vpdn group-web")
print res
resArr = res.match(/vpdn-group\s+\w+/ig)
print "^^^^^^^^"+resArr
if resArr == null :
	print 'warn'
	errorFlag = 1
	add_problem("noVConError")
	return 'warn'
end
while num < resArr.length :
	commend = "show run | begin "+resArr[num]
	res = cli(commend)
	print res
	resAl = res.split(/!\s?\r?\n/)
	resAll = resAl[0]
	resTmp = resAll.match(/accept-dialin/ig)
	print resTmp
	if resTmp == null :
		print 'warn'
		errorFlag = 1
		add_problem("noDiaError")
	end	

	resTmp = resAll.match(/protocol/ig)
	print resTmp
	if resTmp == null :
		print 'warn'
		errorFlag = 1
		add_problem("noProError")
	end	

	resTmp = resAll.match(/virtual-template/ig)
	print resTmp
	if resTmp == null :
		print 'warn'
		errorFlag = 1
		add_problem("noTmpError")
	end	
	num = num + 1
end
if 	errorFlag == 1 :
	return 'warn'
end
print 'success'
return 'success'