最近使用fishcorecpe和openacs做了一次对接测试,用以学习了解TR069,在此期间感谢fishcorecpe作者木鱼的帮助,在此表示感谢,以下分享一下小弟的测试过程,给后来者一点学习资料.
1. openacs使用的是vmware的版本,进行过升级,直接启动虚拟机,openacs就已经运行. 使用sh taillog就可以观看log
2. fishcorecpe使用的是fishcorecpe-v1.0.1-build20120531-01.tar.gz这个版本,解压,修改 fishcore.conf以符合自己的openacs的配置,如果openacs是默认没有做修改的话只要修改fishcorecpe中的 fishcore.conf中的acsurl就可以了以下是我的fishcore.conf文件,只有一条语句
http://10.0.10.130:8080/openacs/acs
3.实际测试的结果如下:
GetRPCMethods OK
Download OK
Reboot OK
SetParameterValues OK
GetParameterValues OK
GetParameterNames OK
SetParameterAttributes OK
GetParameterAttributes OK
AddObject OK
DeleteObject OK
SetVouchers
GetOptions
Upload OK
FactoryReset OK
4. 使用的测试脚本如下:
SetParameterValues
var parameters = new Array ();
parameters[0] = {name: 'InternetGatewayDevice.ManagementServer.PeriodicInformInterval', value: '160', type: 'xsd:unsignedInt'};
cpe.SetParameterValues (parameters, "MyCommandKey");
GetParameterValues
var parameters = new Array ();
parameters[0] = 'InternetGatewayDevice.ManagementServer.PeriodicInformInterval';
var response = cpe.GetParameterValues (parameters);
logger (response[0].name+'='+response[0].value);
Reboot
cpe.Reboot("commandKey");
FactoryReset
cpe.FactoryReset ();
//GetRPCMethods
// this will output supported methods to server console
var methods = cpe.GetRPCMethods ();
for (i = 0; i < methods.length; i++) {
logger ('Method: '+methods );
}
GetParameterNames
var names = cpe.GetParameterNames ('.', true);
for (i = 0; i < names.length; i++) {
cpe.log (names.name + ' -> '+names.writable);
}
Upload
var response = cpe.Upload("daCommand", "2 Vendor Log File","http://10.0.10.130:8080/openacs/", "", "",000,"upload.log");
logger ("st="+response.StartTime+" status="+response.Status);
SetParameterAttributes
var parameters = new Array();
parameters[0]=new Object;
parameters[0].Name='InternetGatewayDevice.ManagementServer.ConnectionRequestURL';
here: 0-->notification off; 1-->Passive notification; 2-->active notification
parameters[0].Notification=2;
parameters[0].NotificationChange=true;
parameters[0].AccessListChange=true;
parameters[0].AccessList= new Array ();
parameters[0].AccessList[0]='subscriber';
cpe.SetParameterAttributes (parameters);
GetParameterAttributes
var parameters = new Array ();
parameters[0] = 'InternetGatewayDevice.ManagementServer.ConnectionRequestURL';
var response = cpe.GetParameterAttributes(parameters);
logger ('mars test for GetParameterAttributes' +response[0].name+'='+response[0].value);
AddObject
cpe.AddObject ('InternetGatewayDevice.DeviceInfo.X_CT-COM_DHCPOPTION60.', 'heiheihei');
DeleteObject
cpe.DeleteObject('InternetGatewayDevice.DeviceInfo.X_CT-COM_DHCPOPTION60.1', 'heiheihei');
Download
logger ("FIRWARE UPGRADE STARTING");
var response = cpe.Download ("daCommand", "1 Firmware Upgrade Image","http://10.0.10.130:8080/openacs/firmware/2.bin", "", "", 6,"2.bin");
logger ("FIRWARE UPGRADE st="+response.StartTime+" ct="+CompleteTime+" status="+response.Status);
logger ("FIRWARE UPGRADE st="+response.StartTime+" status="+response.Status);
logger ("FIRWARE UPGRADE DONE");
5. 测试过程中需要注意的地方,1.addobject方法,需要注意不是所有节点都支援add和delete方法, 只有协议规定的才可以,所以测试报错的时候请换其他节点试试,上述提到的js是可以行的.2, delete需要指定删除的节点要带上object编号.3. download时如果是firmware需要指定文件的后缀名为bin才可以正确运行(BIN和bin是必须的扩展名).