Commit 835badcc authored by Claes's avatar Claes Committed by Esteban Blanc

Project pwrtest01 and pwrtest02 updates

parent 7d4a69b0
...@@ -2,7 +2,8 @@ my : demo_all ...@@ -2,7 +2,8 @@ my : demo_all
include $(pwr_exe)/pwrp_rules.mk include $(pwr_exe)/pwrp_rules.mk
demo_modules = $(pwrp_exe)/ra_status \ demo_modules = $(pwrp_inc)/ra_plc_user.h \
$(pwrp_exe)/ra_status \
$(pwrp_exe)/ra_nethtest \ $(pwrp_exe)/ra_nethtest \
$(pwrp_exe)/ra_qcom2test \ $(pwrp_exe)/ra_qcom2test \
$(pwrp_exe)/ra_testall_a.sh \ $(pwrp_exe)/ra_testall_a.sh \
...@@ -18,16 +19,21 @@ demo_modules = $(pwrp_exe)/ra_status \ ...@@ -18,16 +19,21 @@ demo_modules = $(pwrp_exe)/ra_status \
$(pwrp_exe)/ra_mhappltest \ $(pwrp_exe)/ra_mhappltest \
$(pwrp_exe)/ra_qcomtest \ $(pwrp_exe)/ra_qcomtest \
$(pwrp_exe)/ra_qmontest \ $(pwrp_exe)/ra_qmontest \
$(pwrp_exe)/ra_modbustcptest \
$(pwrp_exe)/ra_pwrrttest.py \ $(pwrp_exe)/ra_pwrrttest.py \
$(pwrp_exe)/ra_ccmtest.rtt_com \ $(pwrp_exe)/ra_ccmtest.rtt_com \
$(pwrp_exe)/ra_xttscripttest.rtt_com \ $(pwrp_exe)/ra_xttscripttest.rtt_com \
$(pwrp_exe)/ra_testall_c.sh \ $(pwrp_exe)/ra_testall_c.sh \
$(pwrp_exe)/ra_sevtest.py \
$(pwrp_exe)/ra_testall_d.sh \
$(pwrp_obj)/ra_plc_user.o $(pwrp_obj)/ra_plc_user.o
demo_all : $(demo_modules) demo_all : $(demo_modules)
$(pwrp_inc)/ra_plc_user.h : $(pwrp_appl)/ra_plc_user.h
$(pwrp_exe)/ra_status : $(pwrp_appl)/ra_status.cpp $(pwrp_exe)/ra_status : $(pwrp_appl)/ra_status.cpp
@ echo "Building ra_status" @ echo "Building ra_status"
@ g++ -g -o $(target) $(source) $(pwr_obj)/pwr_msg_rt.o -I$(pwr_inc) -L$(pwr_lib) -lpwr_rt -lpwr_co -lpwr_msg_dummy -lrpcsvc -lpthread -lm -lrt @ g++ -g -o $(target) $(source) $(pwr_obj)/pwr_msg_rt.o -I$(pwr_inc) -L$(pwr_lib) -lpwr_rt -lpwr_co -lpwr_msg_dummy -lrpcsvc -lpthread -lm -lrt
...@@ -92,6 +98,10 @@ $(pwrp_exe)/ra_qmontest : $(pwrp_appl)/ra_qmontest.cpp $(pwrp_appl)/ra_qmontest. ...@@ -92,6 +98,10 @@ $(pwrp_exe)/ra_qmontest : $(pwrp_appl)/ra_qmontest.cpp $(pwrp_appl)/ra_qmontest.
@ echo "Building ra_qmontest" @ echo "Building ra_qmontest"
@ g++ -g -o $(target) $(source) $(pwr_obj)/pwr_msg_co.o $(pwr_obj)/pwr_msg_rt.o $(pwr_obj)/pwr_msg_rs.o -I$(pwrp_inc) -I$(pwr_inc) -L$(pwr_lib) -lpwr_rt -lpwr_co -lpwr_msg_dummy -lrpcsvc -lpthread -lm -lrt -Wall @ g++ -g -o $(target) $(source) $(pwr_obj)/pwr_msg_co.o $(pwr_obj)/pwr_msg_rt.o $(pwr_obj)/pwr_msg_rs.o -I$(pwrp_inc) -I$(pwr_inc) -L$(pwr_lib) -lpwr_rt -lpwr_co -lpwr_msg_dummy -lrpcsvc -lpthread -lm -lrt -Wall
$(pwrp_exe)/ra_modbustcptest : $(pwrp_appl)/ra_modbustcptest.cpp
@ echo "Building ra_modbustcptest"
@ g++ -g -o $(target) $(source) $(pwr_obj)/pwr_msg_co.o $(pwr_obj)/pwr_msg_rt.o $(pwr_obj)/pwr_msg_rs.o -I$(pwrp_inc) -I$(pwr_inc) -L$(pwr_lib) -lpwr_rt -lpwr_co -lpwr_msg_dummy -lrpcsvc -lpthread -lm -lrt -Wall
$(pwrp_exe)/ra_pwrrttest.py : $(pwrp_appl)/ra_pwrrttest.py $(pwrp_exe)/ra_pwrrttest.py : $(pwrp_appl)/ra_pwrrttest.py
@ echo "Building ra_pwrrttest" @ echo "Building ra_pwrrttest"
@ cp -p $(source) $(target) @ cp -p $(source) $(target)
...@@ -108,4 +118,12 @@ $(pwrp_exe)/ra_testall_c.sh : $(pwrp_appl)/ra_testall_c.sh ...@@ -108,4 +118,12 @@ $(pwrp_exe)/ra_testall_c.sh : $(pwrp_appl)/ra_testall_c.sh
@ echo "Building ra_testall_c" @ echo "Building ra_testall_c"
@ cp -p $(source) $(target) @ cp -p $(source) $(target)
$(pwrp_exe)/ra_sevtest.py : $(pwrp_appl)/ra_sevtest.py
@ echo "Building ra_sevtest"
@ cp -p $(source) $(target)
$(pwrp_exe)/ra_testall_d.sh : $(pwrp_appl)/ra_testall_d.sh
@ echo "Building ra_testall_d"
@ cp -p $(source) $(target)
$(pwrp_obj)/ra_plc_user.o : $(pwrp_appl)/ra_plc_user.c $(pwrp_obj)/ra_plc_user.o : $(pwrp_appl)/ra_plc_user.c
/*
Print test status
*/
#include <stdio.h>
#include <unistd.h>
#include "pwr.h"
#include "co_cdh.h"
#include "rt_gdh.h"
#include "co_tst_log.h"
static char item[][80] = {
"Test01b-ModbusTCP-Client"
};
int main()
{
pwr_tStatus sts;
unsigned int i;
pwr_tAName aname;
tst_log *log = new tst_log(&sts, "rt-io-ModbusTCP", "$pwrp_log/modbustcp.tlog");
if (EVEN(sts))
printf("** Unable to open log file");
sts = gdh_Init("ra_modbustcptest");
if (EVEN(sts)) {
printf("E ra_modbustcptest, gdh_Init error status: %u\n", sts);
exit(0);
}
// Start the test
pwr_tBoolean bval = 1;
gdh_SetObjectInfo("Test01b-ModbusTCP-Client-Reset.ActualValue", &bval, sizeof(bval));
sleep(1);
gdh_SetObjectInfo("Test01b-ModbusTCP-Client-Start.ActualValue", &bval, sizeof(bval));
sleep(30);
// Log the result
for (i = 0; i < sizeof(item)/sizeof(item[0]); i++) {
pwr_tBoolean val;
pwr_tInt32 state;
strcpy(aname, item[i]);
strcat(aname, "-TestExecuted.ActualValue");
sts = gdh_GetObjectInfo(aname, &val, sizeof(val));
if (EVEN(sts)) {
log->log('E', "Can't find test object", item[i], sts);
continue;
}
if (val != 1) {
log->log('E', "Not tested", item[i]);
continue;
}
strcpy(aname, item[i]);
strcat(aname, "-ErrorDetected.ActualValue");
sts = gdh_GetObjectInfo(aname, &val, sizeof(val));
if (EVEN(sts)) {
log->log('E', "gdh_GetObjectInfo", item[i], sts);
continue;
}
if (val == 1) {
char state_str[80];
strcpy(aname, item[i]);
strcat(aname, "-ErrorState.ActualValue");
sts = gdh_GetObjectInfo(aname, &state, sizeof(state));
if (EVEN(sts)) {
log->log('E', "State not found", item[i], sts);
state = -1;
}
sprintf(state_str, "error state %u", state);
log->log('E', item[i], state_str);
}
else
log->log('I', "Test ok", item[i]);
}
}
...@@ -92,15 +92,20 @@ class Ctx: ...@@ -92,15 +92,20 @@ class Ctx:
def volumes(self): def volumes(self):
d = ('VolPwrTest01c', 'rt', 'pwrs', 'pwrb', 'Simul', 'BaseComponent', d = ('VolPwrTest01c', 'rt', 'pwrs', 'pwrb', 'Simul', 'BaseComponent',
'NMps', 'Profibus', 'CVolPwrtest01', '1_254_254_203') 'NMps', 'Profibus', 'CVolPwrtest01', '1_254_254_203')
i = 0
try: try:
vol = pwrrt.volumes() vol = pwrrt.volumes()
for v in vol: for v in vol:
if v.name() != d[i]: found = False
self.logger.vlog('E', "volumes, Name doesn't match, %s != %s", for dv in d:
v.name(), d[i]) if v.name() == dv:
found = True
break
if not found:
self.logger.vlog('E', "volumes, volume not found %s",
v.name())
return return
i += 1
except RuntimeError as e: except RuntimeError as e:
self.logger.vlog('E', 'volumes, Unexpected exception %s, idx %s', self.logger.vlog('E', 'volumes, Unexpected exception %s, idx %s',
str(e), str(i)) str(e), str(i))
......
This diff is collapsed.
...@@ -17,6 +17,7 @@ dexec() ...@@ -17,6 +17,7 @@ dexec()
let i=0 let i=0
exec "ra_qcom2test" exec "ra_qcom2test"
exec "ra_modbustcptest"
# Wait for spawned processes # Wait for spawned processes
for p in ${pid[*]}; do for p in ${pid[*]}; do
......
#!/bin/bash
exec()
{
echo "Executing $1"
$1
}
dexec()
{
echo "Executing $1"
$1 &
pid[$i]=$!
i=$i+1
}
let i=0
exec "ra_sevtest.py"
# Wait for spawned processes
for p in ${pid[*]}; do
wait $p
done
! Generated by wb_print_wbl 15-MAY-2020 08:19:24.71 ! Generated by wb_print_wbl 17-SEP-2020 13:39:03.46
! Volume CVolPwrtest01 ! Volume CVolPwrtest01
! Version V5.7.1 ! Version V5.7.1
Volume CVolPwrtest01 $ClassVolume 0.0.240.254 Volume CVolPwrtest01 $ClassVolume 0.0.240.254
...@@ -613,7 +613,7 @@ Volume CVolPwrtest01 $ClassVolume 0.0.240.254 ...@@ -613,7 +613,7 @@ Volume CVolPwrtest01 $ClassVolume 0.0.240.254
Object ProString40 $Attribute 33 15-MAY-2020 08:19:17.78 Object ProString40 $Attribute 33 15-MAY-2020 08:19:17.78
Body SysBody 15-MAY-2020 08:19:21.24 Body SysBody 15-MAY-2020 08:19:21.24
Attr PgmName = "ProString40" Attr PgmName = "ProString40"
Attr Size = 80 Attr Size = 40
Attr TypeRef = "pwrs:Type-$ProString40" Attr TypeRef = "pwrs:Type-$ProString40"
EndBody EndBody
EndObject EndObject
......
! Generated by wb_print_wbl 09-SEP-2020 14:12:41.30 ! Generated by wb_print_wbl 14-OCT-2020 16:32:24.65
! Volume directory ! Volume directory
! Version V5.7.1 ! Version V5.7.1
Volume directory $DirectoryVolume 254.254.254.253 Volume directory $DirectoryVolume 254.254.254.253
...@@ -16,7 +16,7 @@ Volume directory $DirectoryVolume 254.254.254.253 ...@@ -16,7 +16,7 @@ Volume directory $DirectoryVolume 254.254.254.253
Attr BusNumber = 999 Attr BusNumber = 999
EndBody EndBody
Object PwrTest01a NodeConfig 10 25-MAR-2020 09:04:16.06 Object PwrTest01a NodeConfig 10 25-MAR-2020 09:04:16.06
Body RtBody 09-SEP-2020 14:12:41.27 Body RtBody 14-OCT-2020 16:32:24.61
Attr NodeName = "pwrtest01a" Attr NodeName = "pwrtest01a"
Attr OperatingSystem = 128 Attr OperatingSystem = 128
Attr Address = "10.255.100.1" Attr Address = "10.255.100.1"
...@@ -57,7 +57,7 @@ Volume directory $DirectoryVolume 254.254.254.253 ...@@ -57,7 +57,7 @@ Volume directory $DirectoryVolume 254.254.254.253
EndObject EndObject
EndObject EndObject
Object PwrTest01b NodeConfig 26 25-MAR-2020 09:06:55.29 Object PwrTest01b NodeConfig 26 25-MAR-2020 09:06:55.29
Body RtBody 09-SEP-2020 14:12:41.27 Body RtBody 14-OCT-2020 16:32:24.61
Attr NodeName = "pwrtest01b" Attr NodeName = "pwrtest01b"
Attr OperatingSystem = 128 Attr OperatingSystem = 128
Attr Address = "10.255.100.2" Attr Address = "10.255.100.2"
...@@ -85,6 +85,11 @@ Volume directory $DirectoryVolume 254.254.254.253 ...@@ -85,6 +85,11 @@ Volume directory $DirectoryVolume 254.254.254.253
Attr Source = "$pwrp_exe/ra_qcom2test" Attr Source = "$pwrp_exe/ra_qcom2test"
EndBody EndBody
EndObject EndObject
Object ra_modbustcptest ApplDistribute 84 14-OCT-2020 14:19:20.72
Body DevBody 14-OCT-2020 14:19:27.38
Attr Source = "$pwrp_exe/ra_modbustcptest"
EndBody
EndObject
Object ra_testall_b ApplDistribute 80 08-SEP-2020 13:16:48.30 Object ra_testall_b ApplDistribute 80 08-SEP-2020 13:16:48.30
Body DevBody 08-SEP-2020 13:16:51.30 Body DevBody 08-SEP-2020 13:16:51.30
Attr Source = "$pwrp_exe/ra_testall_b.sh" Attr Source = "$pwrp_exe/ra_testall_b.sh"
...@@ -93,7 +98,7 @@ Volume directory $DirectoryVolume 254.254.254.253 ...@@ -93,7 +98,7 @@ Volume directory $DirectoryVolume 254.254.254.253
EndObject EndObject
EndObject EndObject
Object PwrTest01c NodeConfig 33 26-MAR-2020 10:23:36.40 Object PwrTest01c NodeConfig 33 26-MAR-2020 10:23:36.40
Body RtBody 09-SEP-2020 14:12:41.27 Body RtBody 14-OCT-2020 16:32:24.61
Attr NodeName = "pwrtest01c" Attr NodeName = "pwrtest01c"
Attr OperatingSystem = 128 Attr OperatingSystem = 128
Attr Address = "127.0.0.1" Attr Address = "127.0.0.1"
...@@ -195,7 +200,7 @@ Volume directory $DirectoryVolume 254.254.254.253 ...@@ -195,7 +200,7 @@ Volume directory $DirectoryVolume 254.254.254.253
EndObject EndObject
EndObject EndObject
Object PwrTest01d SevNodeConfig 38 26-MAR-2020 10:24:30.82 Object PwrTest01d SevNodeConfig 38 26-MAR-2020 10:24:30.82
Body RtBody 09-SEP-2020 14:12:41.27 Body RtBody 14-OCT-2020 16:32:24.61
Attr NodeName = "pwrtest01d" Attr NodeName = "pwrtest01d"
Attr OperatingSystem = 128 Attr OperatingSystem = 128
Attr Address = "10.255.100.3" Attr Address = "10.255.100.3"
...@@ -208,6 +213,22 @@ Volume directory $DirectoryVolume 254.254.254.253 ...@@ -208,6 +213,22 @@ Volume directory $DirectoryVolume 254.254.254.253
Body DevBody 26-MAR-2020 10:24:15.28 Body DevBody 26-MAR-2020 10:24:15.28
Attr Components = 8195 Attr Components = 8195
EndBody EndBody
Object ra_sevtest ApplDistribute 83 16-SEP-2020 15:50:41.21
Body DevBody 16-SEP-2020 15:50:53.32
Attr Source = "$pwrp_exe/ra_sevtest.py"
EndBody
EndObject
Object ra_testall_d ApplDistribute 82 16-SEP-2020 15:50:58.09
Body DevBody 16-SEP-2020 15:51:01.81
Attr Source = "$pwrp_exe/ra_testall_d.sh"
EndBody
EndObject
EndObject
Object BuildOpt BuildOptions 81 14-SEP-2020 08:16:01.44
Body RtBody 14-SEP-2020 08:16:19.58
Attr PlcProcess = "plc"
Attr SystemModules = 2097152
EndBody
EndObject EndObject
EndObject EndObject
EndObject EndObject
...@@ -221,7 +242,7 @@ Volume directory $DirectoryVolume 254.254.254.253 ...@@ -221,7 +242,7 @@ Volume directory $DirectoryVolume 254.254.254.253
Attr OperatingSystem = 128 Attr OperatingSystem = 128
Attr Address = "127.0.0.1" Attr Address = "127.0.0.1"
EndBody EndBody
Object VolPwrTest01c RootVolumeLoad 57 01-JUN-2020 10:05:00.49 Object VolPwrTest01d RootVolumeLoad 57 14-SEP-2020 08:14:35.02
Body RtBody 01-JUN-2020 10:05:00.49 Body RtBody 01-JUN-2020 10:05:00.49
EndBody EndBody
EndObject EndObject
......
...@@ -2,4 +2,4 @@ VolPwrTest01a 0.254.254.201 PwrTest01a pwrtest01a 999 128 0.000000 0 ...@@ -2,4 +2,4 @@ VolPwrTest01a 0.254.254.201 PwrTest01a pwrtest01a 999 128 0.000000 0
VolPwrTest01b 0.254.254.202 PwrTest01b pwrtest01b 999 128 0.000000 0 VolPwrTest01b 0.254.254.202 PwrTest01b pwrtest01b 999 128 0.000000 0
VolPwrTest01c 0.254.254.203 PwrTest01c pwrtest01c 999 128 0.000000 0 VolPwrTest01c 0.254.254.203 PwrTest01c pwrtest01c 999 128 0.000000 0
VolPwrTest01d 0.254.254.204 PwrTest01d pwrtest01d 999 128 0.000000 1 VolPwrTest01d 0.254.254.204 PwrTest01d pwrtest01d 999 128 0.000000 1
VolPwrTest01c 0.254.254.203 copper_arrow copper-arrow 998 128 0.000000 0 VolPwrTest01d 0.254.254.204 copper_arrow copper-arrow 998 128 0.000000 0
...@@ -47,6 +47,7 @@ appl pwrtest01b S $pwrp_web/*.pdf ...@@ -47,6 +47,7 @@ appl pwrtest01b S $pwrp_web/*.pdf
appl pwrtest01b S $pwrp_web/*.pwg appl pwrtest01b S $pwrp_web/*.pwg
appl pwrtest01b E $pwrp_exe/ra_status appl pwrtest01b E $pwrp_exe/ra_status
appl pwrtest01b E $pwrp_exe/ra_qcom2test appl pwrtest01b E $pwrp_exe/ra_qcom2test
appl pwrtest01b E $pwrp_exe/ra_modbustcptest
appl pwrtest01b E $pwrp_exe/ra_testall_b.sh appl pwrtest01b E $pwrp_exe/ra_testall_b.sh
node pwrtest01c 128 999 0 - - node pwrtest01c 128 999 0 - -
load pwrtest01c load pwrtest01c
...@@ -89,6 +90,8 @@ node pwrtest01d 128 999 0 - - ...@@ -89,6 +90,8 @@ node pwrtest01d 128 999 0 - -
load pwrtest01d load pwrtest01d
appl pwrtest01d W $pwrp_cnf/pwrtest01d/pwr_user2.dat:$pwra_db/pwr_user2.dat $pwra_db/pwr_user2.dat appl pwrtest01d W $pwrp_cnf/pwrtest01d/pwr_user2.dat:$pwra_db/pwr_user2.dat $pwra_db/pwr_user2.dat
appl pwrtest01d W $pwrp_cnf/pwrtest01d/authorized_keys:$pwra_db/authorized_keys /home/pwrp/.ssh/authorized_keys appl pwrtest01d W $pwrp_cnf/pwrtest01d/authorized_keys:$pwra_db/authorized_keys /home/pwrp/.ssh/authorized_keys
appl pwrtest01d E $pwrp_exe/ra_sevtest.py
appl pwrtest01d E $pwrp_exe/ra_testall_d.sh
node copper-arrow 128 998 0 - - node copper-arrow 128 998 0 - -
load copper-arrow load copper-arrow
appl copper-arrow W $pwrp_cnf/copper-arrow/pwr_user2.dat:$pwra_db/pwr_user2.dat $pwra_db/pwr_user2.dat appl copper-arrow W $pwrp_cnf/copper-arrow/pwr_user2.dat:$pwra_db/pwr_user2.dat $pwra_db/pwr_user2.dat
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -1068,7 +1068,7 @@ void wa_ldhtest::GetNextAttrRef(void) ...@@ -1068,7 +1068,7 @@ void wa_ldhtest::GetNextAttrRef(void)
{pwr_cClass_Pwrt02_Component, "Test02-First-R1.Motors[8].Super", "Test02-First-R1.Motors[8].Contactor1.Super", LDH__SUCCESS}, {pwr_cClass_Pwrt02_Component, "Test02-First-R1.Motors[8].Super", "Test02-First-R1.Motors[8].Contactor1.Super", LDH__SUCCESS},
{pwr_cClass_Pwrt02_Component, "Test02-First-R1.Motors[8].Contactor1.Super", "Test02-First-R1.Motors[9].Super", LDH__SUCCESS}, {pwr_cClass_Pwrt02_Component, "Test02-First-R1.Motors[8].Contactor1.Super", "Test02-First-R1.Motors[9].Super", LDH__SUCCESS},
{pwr_cClass_Pwrt02_Component, "Test02-First-R1.Motors[9].Super", "Test02-First-R1.Motors[9].Contactor2.Super", LDH__SUCCESS}, {pwr_cClass_Pwrt02_Component, "Test02-First-R1.Motors[9].Super", "Test02-First-R1.Motors[9].Contactor2.Super", LDH__SUCCESS},
{pwr_cClass_Pwrt02_Component, "Test02-First-R1.Motors[9].Contactor2.Super", "", LDH__NO_TYPE} {pwr_cClass_Pwrt02_Component, "Test02-First-R1.Motors[9].Contactor2.Super", "", LDH__NONEXT}
}; };
pwr_tAttrRef aref, nextaref; pwr_tAttrRef aref, nextaref;
char *nextname; char *nextname;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment