OpenAcs和fishcorecpe对接测试报告
一安装虚拟机(openacsvmware)
Openacs新出的版本0.5有源码下载,同样他居然同时出了一个vmware的版本,已经将程序部署到虚拟机上了,非常好用,只需要通过虚拟机打开即可。具体详细信息我是按照网上提供的资料操作的。我具体不做详细说明,请看openacs与cpe的部署.ppt即可。
二 安装cpe
首先在虚拟机中安装linux(我这儿安装的ubuntu),将fishcorecpe的文件放在/opt目录下,修改fishcore.conf中的acsurl如下:
然后启动,成功显示:
三 对接测试
启动cpe后,acs打印的日志:
搜索cpe,数据序列号:FC1234567890,必须是这个值。当你鼠标点击输入框时,其实系统已经自动搜索到了。如下图:
然后点击detail按钮,将显示此CPE的详细信息。如下图:
测试脚本,我这儿只测试了重启命令,其他命令还没测试,不过应该没问题。 配置过程:
重启效果:
四 openacs使用脚本
目前OpenAcs默认使用Default的脚本进行测试,暂不支持别的名称的脚本 1 重启脚本
cpe.Reboot("commandKey");
测试OK!
2恢复出厂设置脚本
cpe.FactoryReset();
3 CPE支持的方法GetRPCMethods
// this will output supported methods to server console
var methods = cpe.GetRPCMethods();
for (i = 0; i<methods.length; i++) {
logger ('Method: '+methods);
}
4 得到参数名称GetParameterNames
var names = cpe.GetParameterNames ('.', true);
for (i = 0; i<names.length; i++) {
cpe.log (names.name + ' -> '+names.writable);
}
5得到参数的值GetParameterValues
var parameters = new Array ();
parameters[0] = 'InternetGatewayDevice.DeviceInfo.X_CT-COM_TeleComAccount.'; //xgm add for CT test
//parameters[0] = 'InternetGatewayDevice.DeviceInfo.X_CT-COM_TeleComAccount.'; var response = cpe.GetParameterValues (parameters);
logger (response[0].name+'='+response[0].value);
注意:这里parameters参数最后的小数点问题,不是叶子节点,要加"."
6设置参数的值,设置完值之后,可以通过checknode节点名称查看设置的结果(这种查看方法只在fishcorecpe中支持)
var parameters = new Array ();
parameters[0] = {name: 'InternetGatewayDevice.IPPingDiagnostics.Host', value: '192.168.0.1'}; // Encode parameter using default type xsd:string
parameters[1] = {name: 'InternetGatewayDevice.IPPingDiagnostics.NumberOfRepetitions', value: '2'};
// set encoding type
parameters[2] = {name: 'InternetGatewayDevice.IPPingDiagnostics.NumberOfRepetitions', value: '2', type: 'xsd:unsignedInt'};
//xgm add for CT test
parameters[0] = {name: 'InternetGatewayDevice.DeviceInfo.X_CT-COM_TeleComAccount.Enable', value: '0'};
parameters[1] = {name: 'InternetGatewayDevice.DeviceInfo.X_CT-COM_TeleComAccount.UserName', value: 'xgmtest'}; parameters[2] = {name: 'InternetGatewayDevice.DeviceInfo.X_CT-COM_TeleComAccount.Password', value: 'hahapassword'};
cpe.SetParameterValues (parameters, "commandKey");
对于ping的结果可以通过写脚本来读取,通过节面直接读的话读不到。
InternetGatewayDevice.IPPingDiagnostics.AverageResponseTime
InternetGatewayDevice.IPPingDiagnostics. DSCP
InternetGatewayDevice.IPPingDiagnostics.DataBlockSize
InternetGatewayDevice.IPPingDiagnostics.DiagnosticsState
InternetGatewayDevice.IPPingDiagnostics.FailureCount
InternetGatewayDevice.IPPingDiagnostics. Interface
InternetGatewayDevice.IPPingDiagnostics.MaximumResponseTime
InternetGatewayDevice.IPPingDiagnostics.MinimumResponseTime
InternetGatewayDevice.IPPingDiagnostics.NumberOfRepetitions
InternetGatewayDevice.IPPingDiagnostics.SuccessCount
InternetGatewayDevice.IPPingDiagnostics. Timeout
7软件升级
以下这些步骤都是测试软件升级的步骤。Fishcorecpe测试软件升级不成功,报错:mysql数据库中插入数据异常。
1)首先,服务器上要建立升级文件的目录,具体见"settings"-->"Firmware directory"
2) 然后通过网页上传升级文件,具体见"Hardware models"-->"具体CPE型号" -->"Firmware"-->"Create"
3) 设置CPE是否升级软件,具体见"Device profile"-->"Default"-->"添加具体CPE对应的升级版本"
4)等待period event time后,即可看到升级过程
备注:img具体地址在http://ip:8080/openacs/firmware/3.12L.02
可在"Configuration scripts"里写升级脚本。可以自定义控制升级。
logger ("FIRWARE UPGRADE STARTING");
var response = cpe.Download ("daCommand", "1 Firmware Upgrade Image","http://192.168.1.86:8080/openacs/firmware/2.img", "", "", 1841146,"2.img");
logger ("FIRWARE UPGRADE st="+response.StartTime+" ct="+CompleteTime+" status="+response.Status);
logger ("FIRWARE UPGRADE DONE");
8 增加节点AddOject
cpe.AddObject ('InternetGatewayDevice.WANDevice.2.WANConnectionDevice.1.WANIPConnection.12.PortMapping.', '');
cpe.AddObject
('InternetGatewayDevice.WANDevice.2.WANConnectionDevice.1.WANIPConn
ection.', '');
测试OK。
9下载配置文件
var response = cpe.Download ("daCommand", "3 Vendor Configuration File","http://192.168.1.86:8080/openacs/firmware/test.conf", "", "",000,"test.conf");
logger ("st="+response.StartTime+" ct="+CompleteTime+" status="+response.Status); 下载过程测试结果:
严重: 00A00D:FC1234567890 Run exception: ReferenceError: "CompleteTime" is not defined. (skriptas#1) line: 1 column: 0
10上传配置文件
var response = cpe.Upload("daCommand", "3 Vendor Configuration File","http://192.168.1.86:8080/openacs/", "", "",000,"upload.conf");
logger ("st="+response.StartTime+" ct="+CompleteTime+" status="+response.Status);
注意:CPE上上传的流程完全正确,使用PUT方法,将文件发送成功,并且有上传成功的消息发出。 但JBoss里不知道上传的文件放在哪里,暂不管,因为我们只做CPE的功能,ACS那边出错不管。
11上传日志文件
var response = cpe.Upload("daCommand", "2 Vendor Log File","http://192.168.1.86:8080/openacs/", "", "",000,"upload.log");
logger ("st="+response.StartTime+" ct="+CompleteTime+" status="+response.Status); //In TR069 also define
// 1 Firmware Upgrade Image
// 2 Web Content
// 3 Vendor Configuration File
// 4 Vendor Log File
测试失败:Fault: CWMP fault cwmp: Upload failure
注意:CPE上上传的流程完全正确,使用PUT方法,将文件发送成功,并且有上传成功的消息发出。
但JBoss里不知道上传的文件放在哪里,暂不管,因为我们只做CPE的功能,ACS那边不管。
12 get attribute测试
var parameters = new Array ();
parameters[0] = 'InternetGatewayDevice.ManagementServer.ConnectionRequestURL'; var response = cpe.GetParameterAttributes(parameters);
logger (response[0].name+'='+response[0].value);
测试结果:
信息: oui=00A00D sn=FC1234567890 Request is
GetParameterAttributesResponse
16:54:55,243 ERROR [STDERR] 2013-2-5 16:54:55 org.openacs.js.Script logger
信息: undefined=undefined
14 set attribute测试
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=0;
parameters[0].NotificationChange=true;
parameters[0].AccessListChange=true;
parameters[0].AccessList= new Array ();
parameters[0].AccessList[0]='subscriber';
cpe.SetParameterAttributes (parameters);
测试成功,可以通过在fishcorecpe中通过【checknode节点名称】查看
15 Delete Object测试
cpe.DeleteObject('InternetGatewayDevice.WANDevice.2.WANConnectionDevice.1.WANIPConnection.12.PortMapping.2.', '');
测试OK。
第二篇:Do Fish Drink
Do Fish Drink?
Fish do drink water, but how they consume it depends on where they live. Water gets into a fish’s body through osmosis, the process in which water diffuses from a higher to a lower concentration. For example, if there is more water outside of a cell than inside, water will try to flow into the cell until there is the same concentration of water on either side of the cell’s membrane. The body of a fish acts the same way, either absorbing or losing water depending on its surroundings.
Whether a fish absorbs or loses water is based on the fact that all fish must maintain a certain amount of salt in their bodies to stay healthy. Fish that live in fresh water have a higher concentration of salt in their bodies than the surrounding water.
Consequently, water continuously flows into the fish’s body to attempt to dilute the amount of salt in the fish until it is equal to the amount of salt in the surrounding water. Since fish cannot allow their salt content to be diminished, their kidneys work overtime to expel excess water in the form of urine.
Ocean fish have the opposite problem. Surrounded by salt water, their bodies contain a relatively lower concentration of salt than the ocean water. In this case, osmosis causes the fish to constantly lose water in order to equalize salt concentration inside and outside the fish.
To partially compensate for the water loss, ocean fish actually drink water through their mouths. To get rid of the excess salt they take in by drinking seawater, they excrete some salt through cells in their gills.
鱼儿喝水吗?
鱼儿确实喝水,但它们怎样喝水却取决于其生存的环境。水通过渗透作用进入鱼儿的身体,在这一过程中,水从高浓度的地方扩散至低浓度的地方。
比方说,如果细胞外的水多于细胞内,水就会流入细胞内,直到细胞膜内外的浓度相同。鱼儿的身体与细胞一样,吸水还是失水取决于它生存的环境。
不管鱼儿吸水还是失水,事实上,所有的鱼要想保持健康其体内就必须维持一定量的盐分。淡水鱼体内盐的浓度要高于周围的水。
因此,水就不断地进入鱼儿的体内以稀释盐份,直到鱼儿体内与外界的盐的浓度持平。因为鱼儿自身无法减少体内的盐分,所以他们的肾就要不断工作以将多余的水以尿液的形式排出体外。
海鱼的问题则恰恰相反。由于被盐水包围,他们体内盐的浓度与海水相比相对较低。在这种情况下,渗透作用使得鱼儿不停地失水以平衡体内外盐的浓度。
为了补偿失去的部分水分,海水鱼通常要用嘴喝水。而为了去除喝海水带来的多余盐分,它们会通过腮里的细胞排出一些盐分。