Feat/ldax control block#38
Conversation
f28fc18 to
0724056
Compare
Signed-off-by: varunchennamadhava <varunchennamadhava@gmail.com>
0724056 to
84eba63
Compare
Signed-off-by: varunchennamadhava <varunchennamadhava@gmail.com>
| assb_json["assbtasb"] = formatter_.getHex<uint32_t>(&(p_assb->assbtasb)); | ||
| assb_json["assbvab"] = formatter_.getHex<uint32_t>(&(p_assb->assbvab)); | ||
| assb_json["assbldax"] = formatter_.getHex<uint32_t>(&(p_assb->assbldax)); | ||
| // assb_json["assbldax"] = formatter_.getHex<uint64_t>(&(p_assb->assbldax)); |
| formatter_.uint<uint64_t>(p_assb->assbldax)); | ||
| assb_json["assbldax"] = | ||
| CBXP::LDAX(cbxp_options) | ||
| .get(const_cast<void*>(reinterpret_cast<const void*>(p_ldax))); |
There was a problem hiding this comment.
I think you should be able to do this in one line of code like for the include processing code for other control blocks, no?
cbxp/cbxp/control_blocks/ascb.cpp
Line 64 in 0a1962f
| // ldax_json["ldax_obtainshomespace"] = | ||
| // formatter_.getString(p_ldax->ldax_obtainshomespace, 8); | ||
| // ldax_json["ldax_obtainshomespacechar"] = | ||
| // formatter_.getString(p_ldax->ldax_obtainshomespacechar, 8); |
There was a problem hiding this comment.
Should these be commented out? All fields are programming interfaces except for LDAX_GetmainsHomeSpace.
https://www.ibm.com/docs/en/zos/3.2.0?topic=isg-ihaldax-information
| for entry in cbdata: | ||
| self.assertIs(type(entry), dict) | ||
|
|
||
| def test_cbxp_can_extract_ldax(self): |
There was a problem hiding this comment.
Update to new naming convention to differentiate extract and format tests.
test_cbxp_extract_forextracttests.test_cbxp_format_forformattests.
| self.assertIs(type(cbdata), dict) | ||
| self.assertIs(type(cbdata["flccvt"]), dict) | ||
| self.assertIs(type(cbdata["flccvt"]["cvtasvt"]), dict) | ||
| self.assertIs(type(cbdata["flccvt"]["cvtasvt"]["asvtenty"]), list) |
There was a problem hiding this comment.
Add asserts for ascb, assb, and ldax?
| run_with_expected_exit_code 0 ./dist/cbxp extract -f "ascb.assb.ldax.ldax_ldasiza=11505664" -i ascb.assb.ldax asvt | ||
| run_with_expected_exit_code 0 ./dist/cbxp extract -f "cvt.asvt.ascb.assb.ldax.ldax_tcthwm=348160" -i cvt.asvt.ascb.assb.ldax psa | ||
| run_with_expected_exit_code 0 ./dist/cbxp extract -f "ldax_tcthwm=348160" ldax | ||
| run_with_expected_null_response ./dist/cbxp extract -f "cvt.asvt.ascb.assb.ldax.ldax_id=INVALID" -i cvt.asvt.ascb.assb.ldax psa |
There was a problem hiding this comment.
Keep in mind that testing with the values you are using for ldax_ldasiza and ldax_tcthwm may not always result in a filter being matched as the values may not be present in any LDAX control blocks on any given system at any given time. I guess this is good enough for testing that the filters are accepted though.
There was a problem hiding this comment.
But for the Python tests, this will likely cause your tests to fail...
There was a problem hiding this comment.
Technically, the Python tests will still pass because the test cases check to see if anything matched the filter, but consider using more reliable filters for these tests.
| ldax_json["ldax_header"] = formatter_.getString(p_ldax->ldax_header, 8); | ||
| ldax_json["ldax_id"] = formatter_.getString(p_ldax->ldax_id, 4); | ||
| ldax_json["ldax_version"] = | ||
| formatter_.getBitmap<uint8_t>(p_ldax->ldax_version); | ||
| ldax_json["ldax_ldaascb"] = | ||
| formatter_.getHex<uint32_t>(&(p_ldax->ldax_ldaascb)); | ||
| ldax_json["ldax_ldastrta"] = | ||
| formatter_.getHex<uint32_t>(&(p_ldax->ldax_ldastrta)); | ||
| ldax_json["ldax_ldasiza"] = p_ldax->ldax_ldasiza; | ||
| ldax_json["ldax_ldaestra"] = | ||
| formatter_.getHex<uint32_t>(&(p_ldax->ldax_ldaestra)); | ||
| ldax_json["ldax_ldaesiza"] = p_ldax->ldax_ldaesiza; | ||
| ldax_json["ldax_ldacrgtp"] = | ||
| formatter_.getHex<uint32_t>(&(p_ldax->ldax_ldacrgtp)); | ||
| ldax_json["ldax_ldaergtp"] = | ||
| formatter_.getHex<uint32_t>(&(p_ldax->ldax_ldaergtp)); | ||
| ldax_json["ldax_ldalimit"] = | ||
| formatter_.getHex<uint32_t>(&(p_ldax->ldax_ldalimit)); | ||
| ldax_json["ldax_ldavvrg"] = | ||
| formatter_.getHex<uint32_t>(&(p_ldax->ldax_ldavvrg)); | ||
| ldax_json["ldax_ldaelim"] = | ||
| formatter_.getHex<uint32_t>(&(p_ldax->ldax_ldaelim)); | ||
| ldax_json["ldax_ldaevvrg"] = | ||
| formatter_.getHex<uint32_t>(&(p_ldax->ldax_ldaevvrg)); | ||
| ldax_json["ldax_ldaloal"] = | ||
| formatter_.getBitmap<uint32_t>(p_ldax->ldax_ldaloal); | ||
| ldax_json["ldax_ldahial"] = | ||
| formatter_.getBitmap<uint32_t>(p_ldax->ldax_ldahial); | ||
| ldax_json["ldax_ldaeloal"] = | ||
| formatter_.getBitmap<uint32_t>(p_ldax->ldax_ldaeloal); | ||
| ldax_json["ldax_ldaehial"] = | ||
| formatter_.getBitmap<uint32_t>(p_ldax->ldax_ldaehial); | ||
| // ldax_json["ldax_tctvalus"] = formatter_.getString(p_ldax->ldax_tctvalus, | ||
| // 16); | ||
| ldax_json["ldax_tcthwm"] = p_ldax->ldax_tcthwm; | ||
| ldax_json["ldax_tctlwm"] = p_ldax->ldax_tctlwm; | ||
| ldax_json["ldax_tctehwm"] = p_ldax->ldax_tctehwm; | ||
| ldax_json["ldax_tctelwm"] = p_ldax->ldax_tctelwm; | ||
| ldax_json["ldax_curhighbot"] = | ||
| formatter_.getHex<uint32_t>(&(p_ldax->ldax_curhighbot)); | ||
| ldax_json["ldax_curehighbot"] = | ||
| formatter_.getHex<uint32_t>(&(p_ldax->ldax_curehighbot)); | ||
| ldax_json["ldax_ldasmad"] = | ||
| formatter_.getHex<uint32_t>(&(p_ldax->ldax_ldasmad)); | ||
| ldax_json["ldax_ldasmsz"] = | ||
| formatter_.getHex<uint32_t>(&(p_ldax->ldax_ldasmsz)); |
There was a problem hiding this comment.
@lcarcaramo can disagree with me, but even though this is how the fields are named in the header file, I think we should remove the ldax_ from these json keys for consistency with the other control blocks we have implemented.
There was a problem hiding this comment.
This is consistent with the field names being used for the assb control block, so I think this is good, no?
cbxp/cbxp/control_blocks/assb.cpp
Line 82 in 0a1962f
💡 Issue Reference
#27 LDAX
💻 What does this address?
LDAX control block information
📟 Implementation Details
Control Block addition using documentation and shipped out header files.
📋 Is there a test case?
Test cases were included in test case suite and checked manually.