Commit 8a04a63c authored by Claes's avatar Claes Committed by Esteban Blanc

pwrtest01 modifications

parent bde48ec8
...@@ -89,16 +89,33 @@ echo "* Configure adm" ...@@ -89,16 +89,33 @@ echo "* Configure adm"
export pwra_db=$pwre_broot/$os/$hw/bld/project/adm/db export pwra_db=$pwre_broot/$os/$hw/bld/project/adm/db
if [ ! -e $pwra_db ]; then if [ ! -e $pwra_db ]; then
mkdir -p $pwra_db mkdir -p $pwra_db
cp $pwre_croot/src/tools/pkg/deb/adm/* $pwra_db/
fi
if [ ! -e $pwra_db ]; then
mkdir -p $pwra_db
cp $pwre_croot/src/tools/pkg/deb/adm/* $pwra_db/
fi
if [ "`eval grep CVolPwrtest01 $pwra_db/pwr_volumelist.dat`" == "" ]; then
echo "CVolPwrtest01 0.0.254.254 pwrtest01" >> $pwra_db/pwr_volumelist.dat
fi
if [ "`eval grep VolPwrTest01a $pwra_db/pwr_volumelist.dat`" == "" ]; then
echo "VolPwrTest01a 0.254.254.201 pwrtest01" >> $pwra_db/pwr_volumelist.dat
fi
if [ "`eval grep VolPwrTest01b $pwra_db/pwr_volumelist.dat`" == "" ]; then
echo "VolPwrTest01b 0.254.254.202 pwrtest01" >> $pwra_db/pwr_volumelist.dat
fi
if [ "`eval grep VolPwrTest01c $pwra_db/pwr_volumelist.dat`" == "" ]; then
echo "VolPwrTest01c 0.254.254.203 pwrtest01" >> $pwra_db/pwr_volumelist.dat
fi
if [ "`eval grep VolPwrTest01d $pwra_db/pwr_volumelist.dat`" == "" ]; then
echo "VolPwrTest01d 0.254.254.204 pwrtest01" >> $pwra_db/pwr_volumelist.dat
fi
if [ ! -e $pwra_db/pwr_projectlist.dat ] || [ "`eval grep base $pwra_db/pwr_projectlist.dat`" == "" ]; then
echo "%base V0.0.0 $pwre_broot" > $pwra_db/pwr_projectlist.dat
fi
if [ "`eval grep pwrtest01 $pwra_db/pwr_projectlist.dat`" == "" ]; then
echo "pwrtest01 V0.0.0 $pwrp_root Test-pwrtest01 \"\"" >> $pwra_db/pwr_projectlist.dat
fi fi
echo "pwra_db $pwra_db"
cp $pwre_croot/src/tools/pkg/deb/adm/* $pwra_db/
echo "CVolPwrtest01 0.0.254.254 pwrtest01" >> $pwra_db/pwr_volumelist.dat
echo "VolPwrTest01a 0.254.254.201 pwrtest01" >> $pwra_db/pwr_volumelist.dat
echo "VolPwrTest01b 0.254.254.202 pwrtest01" >> $pwra_db/pwr_volumelist.dat
echo "VolPwrTest01c 0.254.254.203 pwrtest01" >> $pwra_db/pwr_volumelist.dat
echo "VolPwrTest01d 0.254.254.204 pwrtest01" >> $pwra_db/pwr_volumelist.dat
echo "%base V0.0.0 $pwre_broot" > $pwra_db/pwr_projectlist.dat
echo "pwrtest01 V0.0.0 $pwrp_root Test-pwrtest01 \"\"" >> $pwra_db/pwr_projectlist.dat
source $pwra_db/pwr_setup.sh source $pwra_db/pwr_setup.sh
source $pwra_db/pwra_env.sh set project pwrtest01 source $pwra_db/pwra_env.sh set project pwrtest01
......
...@@ -76,7 +76,7 @@ ra_aproctest::ra_aproctest() ...@@ -76,7 +76,7 @@ ra_aproctest::ra_aproctest()
pwr_tOid oid; pwr_tOid oid;
m_anix = errh_eAnix_appl3; m_anix = errh_eAnix_appl3;
m_log = new tst_log(&m_sts, "rt-Aproc", "$pwrp_log/aproc.log"); m_log = new tst_log(&m_sts, "rt-Aproc", "$pwrp_log/aproc.tlog");
if (EVEN(m_sts)) if (EVEN(m_sts))
printf("** Unable to open log file"); printf("** Unable to open log file");
m_sts = gdh_Init("ra_aproctest"); m_sts = gdh_Init("ra_aproctest");
......
...@@ -990,7 +990,7 @@ main() ...@@ -990,7 +990,7 @@ main()
int log; int log;
verify(0); verify(0);
log = tstlog_open("co-Ccm", "$pwrp_log/ccm.log"); log = tstlog_open("co-Ccm", "$pwrp_log/ccm.tlog");
ccm_declarations(log); ccm_declarations(log);
ccm_operators(log); ccm_operators(log);
......
...@@ -1277,7 +1277,7 @@ void ra_cdhtest::AttrElemSize(void) ...@@ -1277,7 +1277,7 @@ void ra_cdhtest::AttrElemSize(void)
// Constructor // Constructor
ra_cdhtest::ra_cdhtest() ra_cdhtest::ra_cdhtest()
{ {
m_log = new tst_log(&m_sts, "co-Cdh", "$pwrp_log/cdh.log"); m_log = new tst_log(&m_sts, "co-Cdh", "$pwrp_log/cdh.tlog");
if (EVEN(m_sts)) if (EVEN(m_sts))
printf("** Unable to open log file"); printf("** Unable to open log file");
} }
......
...@@ -561,7 +561,7 @@ ra_errhtest::ra_errhtest() ...@@ -561,7 +561,7 @@ ra_errhtest::ra_errhtest()
pwr_tOid oid; pwr_tOid oid;
m_anix = errh_eAnix_appl1; m_anix = errh_eAnix_appl1;
m_log = new tst_log(&m_sts, "rt-Errh", "$pwrp_log/errh.log"); m_log = new tst_log(&m_sts, "rt-Errh", "$pwrp_log/errh.tlog");
if (EVEN(m_sts)) if (EVEN(m_sts))
printf("** Unable to open log file"); printf("** Unable to open log file");
m_sts = gdh_Init("ra_errhtest"); m_sts = gdh_Init("ra_errhtest");
......
...@@ -928,55 +928,6 @@ void ra_gdhtest::GetPreviousSibling(void) ...@@ -928,55 +928,6 @@ void ra_gdhtest::GetPreviousSibling(void)
} }
#if 0
void ra_gdhtest::GetPreviousSibling(void)
{
pwr_tOName name;
pwr_tOid oid;
// Get last sibling of first child
m_sts = gdh_GetNextSibling(m_child, &oid);
if (ODD(m_sts))
m_sts = gdh_GetNextSibling(oid, &oid);
if (ODD(m_sts))
m_sts = gdh_GetNextSibling(oid, &oid);
if (ODD(m_sts))
m_sts = gdh_GetNextSibling(oid, &oid);
m_sts = gdh_GetPreviousSibling(oid, &oid);
if (EVEN(m_sts)) {
m_log->log('E', "GetPreviousSibling", m_sts);
return;
}
m_sts = gdh_ObjidToName(oid, name, sizeof(name), cdh_mNName);
if (EVEN(m_sts)) {
m_log->log('E', "GetPreviousSibling", "ObjidToName failed", m_sts);
return;
}
if (strcmp(name, "RootObject-Child3") != 0) {
m_log->log('E', "GetPreviousSibling", "Wrong silbing");
return;
}
// Get nonexisting child
m_sts = gdh_GetPreviousSibling(oid, &oid);
if (ODD(m_sts))
m_sts = gdh_GetPreviousSibling(oid, &oid);
if (ODD(m_sts))
m_sts = gdh_GetPreviousSibling(oid, &oid);
if (ODD(m_sts)) {
m_log->log('E', "GetPreviousSibling returned noexisting object");
return;
}
else if (m_sts != GDH__NO_SIBLING) {
m_log->log('E', "GetPreviousSibling wrong sts", m_sts);
return;
}
m_log->log('S', "GetPreviousSibling", GDH__SUCCESS);
}
#endif
void ra_gdhtest::GetNodeIndex(void) void ra_gdhtest::GetNodeIndex(void)
{ {
pwr_tNid nid; pwr_tNid nid;
...@@ -1325,409 +1276,111 @@ void ra_gdhtest::GetAttributeCharAttrref(void) ...@@ -1325,409 +1276,111 @@ void ra_gdhtest::GetAttributeCharAttrref(void)
m_log->log('S', "GetAttributeCharAttrref", GDH__SUCCESS); m_log->log('S', "GetAttributeCharAttrref", GDH__SUCCESS);
} }
void ra_gdhtest::NameToAttrref(void)
{
pwr_tAttrRef aref;
pwr_tAName aname;
// Get ordinary attribute typedef struct {
sprintf(aname, "RootObject-Child1.Photo"); pwr_tOName aname;
m_sts = gdh_NameToAttrref(pwr_cNOid, aname, &aref); pwr_tOName result;
if (EVEN(m_sts)) { pwr_tStatus sts;
m_log->log('E', "NameToAttrref, can't get aref", m_sts); } sNameToAttrRef;
return;
}
// Get object attribute void ra_gdhtest::NameToAttrref(void)
sprintf(aname, "RootObject-Child1-P1.CircuitBreaker.NotTripped"); {
m_sts = gdh_NameToAttrref(pwr_cNOid, aname, &aref); sNameToAttrRef d[] = {
if (EVEN(m_sts)) { {"RootObject-Child1.Photo", "RootObject-Child1.Photo", GDH__SUCCESS},
m_log->log('E', "NameToAttrref", m_sts); {"RootObject-Child1-P1.CircuitBreaker.NotTripped", "RootObject-Child1-P1.CircuitBreaker.NotTripped", GDH__SUCCESS},
return; {"RootObject-Child1-A1.Value", "RootObject-Child1-A1.Value", GDH__SUCCESS},
} {"RootObject-Child1-A1.Value[99]", "RootObject-Child1-A1.Value[99]", GDH__SUCCESS}
};
// Get array attribute pwr_tAttrRef aref;
sprintf(aname, "RootObject-Child1-A1.Value"); pwr_tAName aname2;
m_sts = gdh_NameToAttrref(pwr_cNOid, aname, &aref);
if (EVEN(m_sts)) {
m_log->log('E', "NameToAttrref, can't get aref", m_sts);
return;
}
// Get array element attributes for (unsigned int i = 0; i < sizeof(d)/sizeof(d[0]); i++) {
for (int i = 0; i < 100; i++) { m_sts = gdh_NameToAttrref(pwr_cNOid, d[i].aname, &aref);
sprintf(aname, "RootObject-Child1-A1.Value[%d]", i); if (m_sts != d[i].sts) {
m_sts = gdh_NameToAttrref(pwr_cNOid, aname, &aref); m_log->log('E', "NameToAttrref, wrong sts", d[i].aname, m_sts);
if (EVEN(m_sts)) {
m_log->log('E', "NameToAttrref, can't get aref", m_sts);
return; return;
} }
if (ODD(m_sts)) {
m_sts = gdh_AttrrefToName(&aref, aname2, sizeof(aname2), cdh_mNName);
if (EVEN(m_sts)) {
m_log->log('E', "NameToAttrref, gdh_AttrrefToName", d[i].aname, m_sts);
return;
}
if (strcmp(aname2, d[i].result) != 0) {
m_log->vlog('E', "NameToAttrref, %s != %s, idx %d", aname2, d[i].result, i);
return;
}
}
} }
m_log->log('S', "NameToAttrref", GDH__SUCCESS); m_log->log('S', "NameToAttrref", GDH__SUCCESS);
} }
typedef struct {
pwr_tOName aname;
int nametype;
pwr_tOName result;
pwr_tStatus sts;
} sAttrRefToName;
void ra_gdhtest::AttrrefToName(void) void ra_gdhtest::AttrrefToName(void)
{ {
pwr_tAttrRef aref; sAttrRefToName d[] = {
pwr_tAName aname, aname2; {"RootObject-Child1.Photo", cdh_mNName, "RootObject-Child1.Photo", GDH__SUCCESS},
{"RootObject-Child1.Photo", cdh_mName_object, "Child1", GDH__SUCCESS},
// Get ordinary attribute {"RootObject-Child1.Photo", cdh_mName_attribute, "Photo", GDH__SUCCESS},
sprintf(aname, "RootObject-Child1.Photo"); {"RootObject-Child1.Photo", cdh_mName_object | cdh_mName_attribute, "Child1.Photo", GDH__SUCCESS},
m_sts = gdh_NameToAttrref(pwr_cNOid, aname, &aref); {"RootObject-Child1.Photo", cdh_mName_volumeStrict, "VolPwrTest01c:RootObject-Child1.Photo", GDH__SUCCESS},
if (EVEN(m_sts)) { {"RootObject-Child1.Photo", cdh_mName_pathStrict, "RootObject-Child1.Photo", GDH__SUCCESS},
m_log->log('E', "AttrrefToName can't get aref", m_sts); {"RootObject-Child1-P1.CircuitBreaker.NotTripped", cdh_mNName, "RootObject-Child1-P1.CircuitBreaker.NotTripped", GDH__SUCCESS},
return; {"RootObject-Child1-P1.CircuitBreaker.NotTripped", cdh_mName_object, "P1", GDH__SUCCESS},
} {"RootObject-Child1-P1.CircuitBreaker.NotTripped", cdh_mName_attribute, "CircuitBreaker.NotTripped", GDH__SUCCESS},
{"RootObject-Child1-P1.CircuitBreaker.NotTripped", cdh_mName_object | cdh_mName_attribute, "P1.CircuitBreaker.NotTripped", GDH__SUCCESS},
m_sts = gdh_AttrrefToName(&aref, aname2, sizeof(aname2), cdh_mNName); {"RootObject-Child1-P1.CircuitBreaker.NotTripped", cdh_mName_volumeStrict, "VolPwrTest01c:RootObject-Child1-P1.CircuitBreaker.NotTripped", GDH__SUCCESS},
if (EVEN(m_sts)) { {"RootObject-Child1-P1.CircuitBreaker.NotTripped", cdh_mName_pathStrict, "RootObject-Child1-P1.CircuitBreaker.NotTripped", GDH__SUCCESS},
m_log->log('E', "AttrrefToName", m_sts); {"RootObject-Child1-P1.CircuitBreaker.NotTripped.Photo", cdh_mNName, "RootObject-Child1-P1.CircuitBreaker.NotTripped.Photo", GDH__SUCCESS},
return; {"RootObject-Child1-P1.CircuitBreaker.NotTripped.Photo", cdh_mName_object, "P1", GDH__SUCCESS},
} {"RootObject-Child1-P1.CircuitBreaker.NotTripped.Photo", cdh_mName_attribute, "CircuitBreaker.NotTripped.Photo", GDH__SUCCESS},
if (strcmp(aname2, "RootObject-Child1.Photo") != 0) { {"RootObject-Child1-P1.CircuitBreaker.NotTripped.Photo", cdh_mName_volumeStrict, "VolPwrTest01c:RootObject-Child1-P1.CircuitBreaker.NotTripped.Photo", GDH__SUCCESS},
m_log->log('E', "AttrrefToName", aname2); {"RootObject-Child1-P1.CircuitBreaker.NotTripped.Photo", cdh_mName_pathStrict, "RootObject-Child1-P1.CircuitBreaker.NotTripped.Photo", GDH__SUCCESS},
return; {"RootObject-Child1-A1.Value", cdh_mNName, "RootObject-Child1-A1.Value", GDH__SUCCESS},
} {"RootObject-Child1-A1.Value", cdh_mName_object, "A1", GDH__SUCCESS},
{"RootObject-Child1-A1.Value", cdh_mName_attribute, "Value", GDH__SUCCESS},
m_sts = gdh_AttrrefToName(&aref, aname2, sizeof(aname2), cdh_mName_object); {"RootObject-Child1-A1.Value", cdh_mName_volumeStrict, "VolPwrTest01c:RootObject-Child1-A1.Value", GDH__SUCCESS},
if (EVEN(m_sts)) { {"RootObject-Child1-A1.Value", cdh_mName_pathStrict, "RootObject-Child1-A1.Value", GDH__SUCCESS},
m_log->log('E', "AttrrefToName", m_sts); {"RootObject-Child1-A1.Value[99]", cdh_mNName, "RootObject-Child1-A1.Value[99]", GDH__SUCCESS},
return; {"RootObject-Child1-A1.Value[99]", cdh_mName_object, "A1", GDH__SUCCESS},
} {"RootObject-Child1-A1.Value[99]", cdh_mName_attribute, "Value", GDH__SUCCESS},
if (strcmp(aname2, "Child1") != 0) { {"RootObject-Child1-A1.Value[99]", cdh_mName_object | cdh_mName_attribute | cdh_mName_index, "A1.Value[99]", GDH__SUCCESS},
m_log->log('E', "AttrrefToName", aname2); {"RootObject-Child1-A1.Value[99]", cdh_mName_volumeStrict, "VolPwrTest01c:RootObject-Child1-A1.Value[99]", GDH__SUCCESS},
return; {"RootObject-Child1-A1.Value[99]", cdh_mName_pathStrict, "RootObject-Child1-A1.Value[99]", GDH__SUCCESS}
} };
m_sts = gdh_AttrrefToName(&aref, aname2, sizeof(aname2), cdh_mName_attribute);
if (EVEN(m_sts)) {
m_log->log('E', "AttrrefToName", m_sts);
return;
}
if (strcmp(aname2, "Photo") != 0) {
m_log->log('E', "AttrrefToName", aname2);
return;
}
m_sts = gdh_AttrrefToName(&aref, aname2, sizeof(aname2), cdh_mName_object |
cdh_mName_attribute);
if (EVEN(m_sts)) {
m_log->log('E', "AttrrefToName", m_sts);
return;
}
if (strcmp(aname2, "Child1.Photo") != 0) {
m_log->log('E', "AttrrefToName", aname2);
return;
}
m_sts = gdh_AttrrefToName(&aref, aname2, sizeof(aname2), cdh_mName_volumeStrict);
if (EVEN(m_sts)) {
m_log->log('E', "AttrrefToName", m_sts);
return;
}
if (strcmp(aname2, "VolPwrTest01c:RootObject-Child1.Photo") != 0) {
m_log->log('E', "AttrrefToName", aname2);
return;
}
m_sts = gdh_AttrrefToName(&aref, aname2, sizeof(aname2), cdh_mName_pathStrict);
if (EVEN(m_sts)) {
m_log->log('E', "AttrrefToName", m_sts);
return;
}
if (strcmp(aname2, "RootObject-Child1.Photo") != 0) {
m_log->log('E', "AttrrefToName", aname2);
return;
}
// Get object attribute
sprintf(aname, "RootObject-Child1-P1.CircuitBreaker.NotTripped");
m_sts = gdh_NameToAttrref(pwr_cNOid, aname, &aref);
if (EVEN(m_sts)) {
m_log->log('E', "AttrrefToName can't get aref", m_sts);
return;
}
m_sts = gdh_AttrrefToName(&aref, aname2, sizeof(aname2), cdh_mNName);
if (EVEN(m_sts)) {
m_log->log('E', "AttrrefToName", m_sts);
return;
}
if (strcmp(aname2, "RootObject-Child1-P1.CircuitBreaker.NotTripped") != 0) {
m_log->log('E', "AttrrefToName", aname2);
return;
}
m_sts = gdh_AttrrefToName(&aref, aname2, sizeof(aname2), cdh_mName_object);
if (EVEN(m_sts)) {
m_log->log('E', "AttrrefToName", m_sts);
return;
}
if (strcmp(aname2, "P1") != 0) {
m_log->log('E', "AttrrefToName", aname2);
return;
}
m_sts = gdh_AttrrefToName(&aref, aname2, sizeof(aname2), cdh_mName_attribute);
if (EVEN(m_sts)) {
m_log->log('E', "AttrrefToName", m_sts);
return;
}
if (strcmp(aname2, "CircuitBreaker.NotTripped") != 0) {
m_log->log('E', "AttrrefToName", aname2);
return;
}
m_sts = gdh_AttrrefToName(&aref, aname2, sizeof(aname2), cdh_mName_object |
cdh_mName_attribute);
if (EVEN(m_sts)) {
m_log->log('E', "AttrrefToName", m_sts);
return;
}
if (strcmp(aname2, "P1.CircuitBreaker.NotTripped") != 0) {
m_log->log('E', "AttrrefToName", aname2);
return;
}
m_sts = gdh_AttrrefToName(&aref, aname2, sizeof(aname2), cdh_mName_volumeStrict);
if (EVEN(m_sts)) {
m_log->log('E', "AttrrefToName", m_sts);
return;
}
if (strcmp(aname2, "VolPwrTest01c:RootObject-Child1-P1.CircuitBreaker.NotTripped") != 0) {
m_log->log('E', "AttrrefToName", aname2);
return;
}
m_sts = gdh_AttrrefToName(&aref, aname2, sizeof(aname2), cdh_mName_pathStrict);
if (EVEN(m_sts)) {
m_log->log('E', "AttrrefToName", m_sts);
return;
}
if (strcmp(aname2, "RootObject-Child1-P1.CircuitBreaker.NotTripped") != 0) {
m_log->log('E', "AttrrefToName", aname2);
return;
}
// Get attrobject attribute
sprintf(aname, "RootObject-Child1-P1.CircuitBreaker.NotTripped.Photo");
m_sts = gdh_NameToAttrref(pwr_cNOid, aname, &aref);
if (EVEN(m_sts)) {
m_log->log('E', "AttrrefToName can't get aref", m_sts);
return;
}
m_sts = gdh_AttrrefToName(&aref, aname2, sizeof(aname2), cdh_mNName);
if (EVEN(m_sts)) {
m_log->log('E', "AttrrefToName", m_sts);
return;
}
if (strcmp(aname2, "RootObject-Child1-P1.CircuitBreaker.NotTripped.Photo") != 0) {
m_log->log('E', "AttrrefToName", aname2);
return;
}
m_sts = gdh_AttrrefToName(&aref, aname2, sizeof(aname2), cdh_mName_object);
if (EVEN(m_sts)) {
m_log->log('E', "AttrrefToName", m_sts);
return;
}
if (strcmp(aname2, "P1") != 0) {
m_log->log('E', "AttrrefToName", aname2);
return;
}
m_sts = gdh_AttrrefToName(&aref, aname2, sizeof(aname2), cdh_mName_attribute);
if (EVEN(m_sts)) {
m_log->log('E', "AttrrefToName", m_sts);
return;
}
if (strcmp(aname2, "CircuitBreaker.NotTripped.Photo") != 0) {
m_log->log('E', "AttrrefToName", aname2);
return;
}
m_sts = gdh_AttrrefToName(&aref, aname2, sizeof(aname2), cdh_mName_object |
cdh_mName_attribute);
if (EVEN(m_sts)) {
m_log->log('E', "AttrrefToName", m_sts);
return;
}
if (strcmp(aname2, "P1.CircuitBreaker.NotTripped.Photo") != 0) {
m_log->log('E', "AttrrefToName", aname2);
return;
}
m_sts = gdh_AttrrefToName(&aref, aname2, sizeof(aname2), cdh_mName_volumeStrict);
if (EVEN(m_sts)) {
m_log->log('E', "AttrrefToName", m_sts);
return;
}
if (strcmp(aname2, "VolPwrTest01c:RootObject-Child1-P1.CircuitBreaker.NotTripped.Photo") != 0) {
m_log->log('E', "AttrrefToName", aname2);
return;
}
m_sts = gdh_AttrrefToName(&aref, aname2, sizeof(aname2), cdh_mName_pathStrict);
if (EVEN(m_sts)) {
m_log->log('E', "AttrrefToName", m_sts);
return;
}
if (strcmp(aname2, "RootObject-Child1-P1.CircuitBreaker.NotTripped.Photo") != 0) {
m_log->log('E', "AttrrefToName", aname2);
return;
}
// Get array attribute
sprintf(aname, "RootObject-Child1-A1.Value");
m_sts = gdh_NameToAttrref(pwr_cNOid, aname, &aref);
if (EVEN(m_sts)) {
m_log->log('E', "AttrrefToName can't get aref", m_sts);
return;
}
m_sts = gdh_AttrrefToName(&aref, aname2, sizeof(aname2), cdh_mNName);
if (EVEN(m_sts)) {
m_log->log('E', "AttrrefToName", m_sts);
return;
}
if (strcmp(aname2, "RootObject-Child1-A1.Value") != 0) {
m_log->log('E', "AttrrefToName", aname2);
return;
}
m_sts = gdh_AttrrefToName(&aref, aname2, sizeof(aname2), cdh_mName_object);
if (EVEN(m_sts)) {
m_log->log('E', "AttrrefToName", m_sts);
return;
}
if (strcmp(aname2, "A1") != 0) {
m_log->log('E', "AttrrefToName", aname2);
return;
}
m_sts = gdh_AttrrefToName(&aref, aname2, sizeof(aname2), cdh_mName_attribute);
if (EVEN(m_sts)) {
m_log->log('E', "AttrrefToName", m_sts);
return;
}
if (strcmp(aname2, "Value") != 0) {
m_log->log('E', "AttrrefToName", aname2);
return;
}
m_sts = gdh_AttrrefToName(&aref, aname2, sizeof(aname2), cdh_mName_object |
cdh_mName_attribute);
if (EVEN(m_sts)) {
m_log->log('E', "AttrrefToName", m_sts);
return;
}
if (strcmp(aname2, "A1.Value") != 0) {
m_log->log('E', "AttrrefToName", aname2);
return;
}
m_sts = gdh_AttrrefToName(&aref, aname2, sizeof(aname2), cdh_mName_volumeStrict);
if (EVEN(m_sts)) {
m_log->log('E', "AttrrefToName", m_sts);
return;
}
if (strcmp(aname2, "VolPwrTest01c:RootObject-Child1-A1.Value") != 0) {
m_log->log('E', "AttrrefToName", aname2);
return;
}
m_sts = gdh_AttrrefToName(&aref, aname2, sizeof(aname2), cdh_mName_pathStrict);
if (EVEN(m_sts)) {
m_log->log('E', "AttrrefToName", m_sts);
return;
}
if (strcmp(aname2, "RootObject-Child1-A1.Value") != 0) {
m_log->log('E', "AttrrefToName", aname2);
return;
}
// Get array element attribute
sprintf(aname, "RootObject-Child1-A1.Value[99]");
m_sts = gdh_NameToAttrref(pwr_cNOid, aname, &aref);
if (EVEN(m_sts)) {
m_log->log('E', "AttrrefToName can't get aref", m_sts);
return;
}
m_sts = gdh_AttrrefToName(&aref, aname2, sizeof(aname2), cdh_mNName);
if (EVEN(m_sts)) {
m_log->log('E', "AttrrefToName", m_sts);
return;
}
if (strcmp(aname2, "RootObject-Child1-A1.Value[99]") != 0) {
m_log->log('E', "AttrrefToName", aname2);
return;
}
m_sts = gdh_AttrrefToName(&aref, aname2, sizeof(aname2), cdh_mName_object);
if (EVEN(m_sts)) {
m_log->log('E', "AttrrefToName", m_sts);
return;
}
if (strcmp(aname2, "A1") != 0) {
m_log->log('E', "AttrrefToName", aname2);
return;
}
m_sts = gdh_AttrrefToName(&aref, aname2, sizeof(aname2), cdh_mName_attribute);
if (EVEN(m_sts)) {
m_log->log('E', "AttrrefToName", m_sts);
return;
}
if (strcmp(aname2, "Value") != 0) {
m_log->log('E', "AttrrefToName", aname2);
return;
}
m_sts = gdh_AttrrefToName(&aref, aname2, sizeof(aname2), cdh_mName_attribute |
cdh_mName_index);
if (EVEN(m_sts)) {
m_log->log('E', "AttrrefToName", m_sts);
return;
}
if (strcmp(aname2, "Value[99]") != 0) {
m_log->log('E', "AttrrefToName", aname2);
return;
}
m_sts = gdh_AttrrefToName(&aref, aname2, sizeof(aname2), cdh_mName_object | pwr_tAttrRef aref;
cdh_mName_attribute | cdh_mName_index); pwr_tAName aname2;
if (EVEN(m_sts)) {
m_log->log('E', "AttrrefToName", m_sts);
return;
}
if (strcmp(aname2, "A1.Value[99]") != 0) {
m_log->log('E', "AttrrefToName", aname2);
return;
}
m_sts = gdh_AttrrefToName(&aref, aname2, sizeof(aname2), cdh_mName_volumeStrict); for (unsigned int i = 0; i < sizeof(d)/sizeof(d[0]); i++) {
if (EVEN(m_sts)) { m_sts = gdh_NameToAttrref(pwr_cNOid, d[i].aname, &aref);
m_log->log('E', "AttrrefToName", m_sts); if (EVEN(m_sts)) {
return; m_log->log('E', "AttrrefToName, gdh_NameToAttrref", m_sts);
} return;
if (strcmp(aname2, "VolPwrTest01c:RootObject-Child1-A1.Value[99]") != 0) { }
m_log->log('E', "AttrrefToName", aname2);
return;
}
m_sts = gdh_AttrrefToName(&aref, aname2, sizeof(aname2), cdh_mName_pathStrict); m_sts = gdh_AttrrefToName(&aref, aname2, sizeof(aname2), d[i].nametype);
if (EVEN(m_sts)) { if (m_sts != d[i].sts) {
m_log->log('E', "AttrrefToName", m_sts); m_log->log('E', "AttrrefToName, wrong sts", d[i].aname, m_sts);
return; return;
} }
if (strcmp(aname2, "RootObject-Child1-A1.Value[99]") != 0) { if (ODD(m_sts)) {
m_log->log('E', "AttrrefToName", aname2); if (strcmp(aname2, d[i].result) != 0) {
return; m_log->vlog('E', "AttrrefToName, %s != %s, idx %d", aname2, d[i].result, i);
return;
}
}
} }
m_log->log('S', "AttrrefToName", GDH__SUCCESS); m_log->log('S', "AttrRefToName", GDH__SUCCESS);
} }
void ra_gdhtest::ClassAttrToAttrref(void) void ra_gdhtest::ClassAttrToAttrref(void)
...@@ -1779,78 +1432,47 @@ void ra_gdhtest::ClassAttrToAttrref(void) ...@@ -1779,78 +1432,47 @@ void ra_gdhtest::ClassAttrToAttrref(void)
m_log->log('S', "ClassAttrToAttrref", GDH__SUCCESS); m_log->log('S', "ClassAttrToAttrref", GDH__SUCCESS);
} }
typedef struct {
pwr_tOName aname;
pwr_tOName oname;
pwr_tStatus sts;
} sAttrArefToObjectAref;
void ra_gdhtest::AttrArefToObjectAref(void) void ra_gdhtest::AttrArefToObjectAref(void)
{ {
pwr_tAttrRef aref, oaref; sAttrArefToObjectAref d[] = {
pwr_tAName aname; {"RootObject-Child1.Photo", "RootObject-Child1", GDH__SUCCESS},
{"RootObject-Child1-A1.Value[99]", "RootObject-Child1-A1", GDH__SUCCESS},
// Test ordinary attribute {"RootObject-Child1-P1.CircuitBreaker.NotTripped", "RootObject-Child1-P1.CircuitBreaker", GDH__SUCCESS}
m_sts = gdh_NameToAttrref(pwr_cNOid, "RootObject-Child1.Photo", &aref); };
if (EVEN(m_sts)) {
m_log->log('E', "AttrArefToObjectAref", "gdh_NameToAttrref", m_sts);
return;
}
m_sts = gdh_AttrArefToObjectAref(&aref, &oaref);
if (EVEN(m_sts)) {
m_log->log('E', "AttrArefToObjectAref", m_sts);
return;
}
m_sts = gdh_AttrrefToName(&oaref, aname, sizeof(aname), cdh_mName_pathStrict);
if (EVEN(m_sts)) {
m_log->log('E', "AttrArefToObjectAref", m_sts);
return;
}
if (strcmp(aname, "RootObject-Child1") != 0) {
m_log->log('E', "AttrArefToObjectAref wrong name", aname);
return;
}
// Test attrobject attribute
m_sts = gdh_NameToAttrref(pwr_cNOid, "RootObject-Child1-P1.CircuitBreaker.NotTripped", &aref);
if (EVEN(m_sts)) {
m_log->log('E', "AttrArefToObjectAref", "gdh_NameToAttrref", m_sts);
return;
}
m_sts = gdh_AttrArefToObjectAref(&aref, &oaref); pwr_tAttrRef aref, oaref;
if (EVEN(m_sts)) { pwr_tAName aname;
m_log->log('E', "AttrArefToObjectAref", m_sts);
return;
}
m_sts = gdh_AttrrefToName(&oaref, aname, sizeof(aname), cdh_mName_pathStrict);
if (EVEN(m_sts)) {
m_log->log('E', "AttrArefToObjectAref", m_sts);
return;
}
if (strcmp(aname, "RootObject-Child1-P1.CircuitBreaker") != 0) {
m_log->log('E', "AttrArefToObjectAref wrong name", aname);
return;
}
// Test array element for (unsigned int i = 0; i < sizeof(d)/sizeof(d[0]); i++) {
m_sts = gdh_NameToAttrref(pwr_cNOid, "RootObject-Child1-A1.Value[99]", &aref); m_sts = gdh_NameToAttrref(pwr_cNOid, d[i].aname, &aref);
if (EVEN(m_sts)) { if (EVEN(m_sts)) {
m_log->log('E', "AttrArefToObjectAref", "gdh_NameToAttrref", m_sts); m_log->log('E', "AttrArefToObjectAref", "gdh_NameToAttrref", m_sts);
return; return;
} }
m_sts = gdh_AttrArefToObjectAref(&aref, &oaref); m_sts = gdh_AttrArefToObjectAref(&aref, &oaref);
if (EVEN(m_sts)) { if (m_sts != d[i].sts) {
m_log->log('E', "AttrArefToObjectAref", m_sts); m_log->log('E', "AttrArefToObjetAref, wrong sts", d[i].aname, m_sts);
return; return;
} }
if (ODD(m_sts)) {
m_sts = gdh_AttrrefToName(&oaref, aname, sizeof(aname), cdh_mName_pathStrict); m_sts = gdh_AttrrefToName(&oaref, aname, sizeof(aname), cdh_mName_pathStrict);
if (EVEN(m_sts)) { if (EVEN(m_sts)) {
m_log->log('E', "AttrArefToObjectAref", m_sts); m_log->log('E', "AttrArefToObjectAref", m_sts);
return; return;
} }
if (strcmp(aname, "RootObject-Child1-A1") != 0) { if (strcmp(aname, d[i].oname) != 0) {
m_log->log('E', "AttrArefToObjectAref wrong name", aname); m_log->vlog('E', "AttrArefToObjectAref wrong name, %s != %s", aname, d[i].oname);
return; return;
}
}
} }
m_log->log('S', "AttrArefToObjectAref", GDH__SUCCESS); m_log->log('S', "AttrArefToObjectAref", GDH__SUCCESS);
...@@ -3748,7 +3370,7 @@ void ra_gdhtest::SetObjectInfoStr(void) ...@@ -3748,7 +3370,7 @@ void ra_gdhtest::SetObjectInfoStr(void)
// Constructor // Constructor
ra_gdhtest::ra_gdhtest() ra_gdhtest::ra_gdhtest()
{ {
m_log = new tst_log(&m_sts, "rt-Gdh", "$pwrp_log/gdh.log"); m_log = new tst_log(&m_sts, "rt-Gdh", "$pwrp_log/gdh.tlog");
if (EVEN(m_sts)) if (EVEN(m_sts))
printf("** Unable to open log file"); printf("** Unable to open log file");
} }
......
...@@ -621,7 +621,7 @@ ra_mhappltest::ra_mhappltest() : m_clean(0), m_checkstatus(0), m_errcnt(0) ...@@ -621,7 +621,7 @@ ra_mhappltest::ra_mhappltest() : m_clean(0), m_checkstatus(0), m_errcnt(0)
{ {
m_mh = this; m_mh = this;
m_clean = 1; m_clean = 1;
m_log = new tst_log(&m_sts, "rt-MhAppl", "$pwrp_log/mhappl.log"); m_log = new tst_log(&m_sts, "rt-MhAppl", "$pwrp_log/mhappl.tlog");
if (EVEN(m_sts)) if (EVEN(m_sts))
printf("** Unable to open log file"); printf("** Unable to open log file");
m_sts = gdh_Init("ra_mhappltest"); m_sts = gdh_Init("ra_mhappltest");
......
...@@ -525,7 +525,7 @@ ra_mhtest::ra_mhtest() : m_clean(0), m_checkstatus(0), m_errcnt(0) ...@@ -525,7 +525,7 @@ ra_mhtest::ra_mhtest() : m_clean(0), m_checkstatus(0), m_errcnt(0)
{ {
m_mh = this; m_mh = this;
m_clean = 1; m_clean = 1;
m_log = new tst_log(&m_sts, "rt-Mh", "$pwrp_log/mh.log"); m_log = new tst_log(&m_sts, "rt-Mh", "$pwrp_log/mh.tlog");
if (EVEN(m_sts)) if (EVEN(m_sts))
printf("** Unable to open log file"); printf("** Unable to open log file");
m_sts = gdh_Init("ra_mhtest"); m_sts = gdh_Init("ra_mhtest");
......
...@@ -87,7 +87,7 @@ void ra_nettimetest::NetTimeToDeltaTime(void) ...@@ -87,7 +87,7 @@ void ra_nettimetest::NetTimeToDeltaTime(void)
// Constructor // Constructor
ra_nettimetest::ra_nettimetest() ra_nettimetest::ra_nettimetest()
{ {
m_log = new tst_log(&m_sts, "rt-NetTime", "$pwrp_log/nettime.log"); m_log = new tst_log(&m_sts, "rt-NetTime", "$pwrp_log/nettime.tlog");
if (EVEN(m_sts)) if (EVEN(m_sts))
printf("** Unable to open log file"); printf("** Unable to open log file");
} }
......
...@@ -115,7 +115,7 @@ int main() ...@@ -115,7 +115,7 @@ int main()
unsigned int i; unsigned int i;
pwr_tAName aname; pwr_tAName aname;
tst_log *log = new tst_log(&sts, "rt-Plc", "$pwrp_log/plc.log"); tst_log *log = new tst_log(&sts, "rt-Plc", "$pwrp_log/plc.tlog");
if (EVEN(sts)) if (EVEN(sts))
printf("** Unable to open log file"); printf("** Unable to open log file");
......
...@@ -1494,7 +1494,7 @@ class Ctx: ...@@ -1494,7 +1494,7 @@ class Ctx:
ctx = Ctx() ctx = Ctx()
ctx.logger = pwrtest.logger('rt-pwrrt', '$pwrp_log/pwrrt.log') ctx.logger = pwrtest.logger('rt-pwrrt', '$pwrp_log/pwrrt.tlog')
try: try:
ctx.init() ctx.init()
except: except:
......
...@@ -1414,7 +1414,7 @@ void ra_qcomtest::Request(void) ...@@ -1414,7 +1414,7 @@ void ra_qcomtest::Request(void)
// Constructor // Constructor
ra_qcomtest::ra_qcomtest() ra_qcomtest::ra_qcomtest()
{ {
m_log = new tst_log(&m_sts, "rt-Qcom", "$pwrp_log/qcom.log"); m_log = new tst_log(&m_sts, "rt-Qcom", "$pwrp_log/qcom.tlog");
if (EVEN(m_sts)) if (EVEN(m_sts))
printf("** Unable to open log file"); printf("** Unable to open log file");
} }
......
...@@ -488,9 +488,9 @@ ra_qmontest::ra_qmontest(eProc ptype) : m_ptype(ptype), m_qquota(500), m_errcnt( ...@@ -488,9 +488,9 @@ ra_qmontest::ra_qmontest(eProc ptype) : m_ptype(ptype), m_qquota(500), m_errcnt(
pwr_tVid vid; pwr_tVid vid;
if (isServer()) if (isServer())
m_log = new tst_log(&m_sts, "rt-Qmon", "$pwrp_log/qmon.log"); m_log = new tst_log(&m_sts, "rt-Qmon", "$pwrp_log/qmon.tlog");
else else
m_log = new tst_log(&m_sts, "rt-QmonClient", "$pwrp_log/qmonc.log"); m_log = new tst_log(&m_sts, "rt-QmonClient", "$pwrp_log/qmonc.tlog");
if (EVEN(m_sts)) if (EVEN(m_sts))
printf("** Unable to open log file"); printf("** Unable to open log file");
......
...@@ -55,7 +55,7 @@ void ra_status::test_status() ...@@ -55,7 +55,7 @@ void ra_status::test_status()
// Constructor // Constructor
ra_status::ra_status() ra_status::ra_status()
{ {
m_log = new tst_log(&m_sts, "rt-Status", "$pwrp_log/tst_status.log"); m_log = new tst_log(&m_sts, "rt-Status", "$pwrp_log/tst_status.tlog");
if (EVEN(m_sts)) if (EVEN(m_sts))
printf("** Unable to open log file"); printf("** Unable to open log file");
......
...@@ -14,6 +14,7 @@ dexec() ...@@ -14,6 +14,7 @@ dexec()
exec "ra_plctest" exec "ra_plctest"
exec "ra_timetest" exec "ra_timetest"
exec "ra_nettimetest"
exec "ra_cdhtest" exec "ra_cdhtest"
exec "ra_gdhtest" exec "ra_gdhtest"
exec "ra_errhtest" exec "ra_errhtest"
......
...@@ -1082,7 +1082,7 @@ void ra_timetest::GetTimeMonotonic(void) ...@@ -1082,7 +1082,7 @@ void ra_timetest::GetTimeMonotonic(void)
// Constructor // Constructor
ra_timetest::ra_timetest() ra_timetest::ra_timetest()
{ {
m_log = new tst_log(&m_sts, "co-Time", "$pwrp_log/time.log"); m_log = new tst_log(&m_sts, "co-Time", "$pwrp_log/time.tlog");
if (EVEN(m_sts)) if (EVEN(m_sts))
printf("** Unable to open log file"); printf("** Unable to open log file");
} }
......
...@@ -596,7 +596,7 @@ main() ...@@ -596,7 +596,7 @@ main()
verify(0); verify(0);
tzset("Europe/Stockholm"); tzset("Europe/Stockholm");
log = tstlog_open("op-XttScript", "$pwrp_log/xttscript.log"); log = tstlog_open("op-XttScript", "$pwrp_log/xttscript.tlog");
ccm_CutObjectName(log); ccm_CutObjectName(log);
ccm_GetAttribute(log); ccm_GetAttribute(log);
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
export PWR_BUS_ID=999 export PWR_BUS_ID=999
if [ -e "/data0/pwrp/tellus/login/sysinfo.txt" ]; then if [ -e "$pwrp_root/src/login/sysinfo.txt" ]; then
echo "-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_" echo "-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_"
echo "Welcome to" echo "Welcome to"
echo "`$pwr_exe/pwrp_env.sh show project`" echo "`$pwr_exe/pwrp_env.sh show project`"
......
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