sas/.sasjslint takes maxLineLength from 180 to 80 - the linter's own default -
and promotes it to "error".
53 of the 258 .sas files already hold a line longer than 80. Rewrapping them
would be a large, reviewable-only-in-theory diff, so each keeps its current
longest line as an exact ceiling via a per-file override, e.g.
@sasjslint {"maxLineLength": 95} in services/validations/tables_all.sas. A
file with no override is held to 80, and an overridden file cannot grow past
the length it has today: the ceiling is the file's longest line, not a round
number.
Both directions were checked: a 101 character line added to an
un-overridden file fails with "Line exceeds maximum length by 21 characters",
and a 114 character line added to macros/mpe_execute.sas (ceiling 101) fails
by 13. `npm run lint:sas` is clean with the setting in force.
78 lines
1.7 KiB
SAS
78 lines
1.7 KiB
SAS
/**
|
|
@file
|
|
@brief testing admin refreshcatalog service - admin gate + libref validation (security)
|
|
@details The service requires membership of the DC administrators
|
|
group and a well-formed libref (or none). An invalid libref aborts
|
|
the service, which shows up as a canceled child job (an aborted
|
|
service registers no webout). The test suite runs as a member of
|
|
the admin group, so the gate passes here.
|
|
|
|
<h4> SAS Macros </h4>
|
|
@li mpe_assert_abort.sas
|
|
@li mp_assert.sas
|
|
@li mpe_execute.sas
|
|
|
|
@sasjslint {"maxLineLength": 89}
|
|
|
|
**/
|
|
|
|
%let _program=&appLoc/services/admin/refreshcatalog;
|
|
|
|
/**
|
|
* Test 1 - an invalid libref must abort the service
|
|
*/
|
|
data work.params1;
|
|
length name $32 value $1000;
|
|
name='libref';value='A.%sysevalf(3+4)B';output;
|
|
run;
|
|
|
|
%mpe_execute(&_program,
|
|
viyacontext=&defaultcontext,
|
|
inputparams=work.params1,
|
|
outref=web1,
|
|
outstatus=work.ab1,
|
|
failfast=0,
|
|
viyaresult=WEBOUT_TXT
|
|
)
|
|
|
|
%mpe_assert_abort(
|
|
desc=Macro content in libref aborts the service,
|
|
outstatus=work.ab1,
|
|
msg=Invalid libref
|
|
)
|
|
|
|
/**
|
|
* Test 2 - a valid libref still refreshes the catalog (admin user)
|
|
*/
|
|
data work.params2;
|
|
length name $32 value $1000;
|
|
name='libref';value='DCTEST';output;
|
|
run;
|
|
|
|
%mpe_execute(&_program,
|
|
viyacontext=&defaultcontext,
|
|
inputparams=work.params2,
|
|
outlib=web2
|
|
)
|
|
|
|
%let msgcheck=0;
|
|
data _null_;
|
|
set web2.sasparams;
|
|
putlog (_all_)(=);
|
|
if index(msg,'Catalog Refresh Complete') then call symputx('msgcheck',1);
|
|
run;
|
|
|
|
%mp_assert(
|
|
iftrue=(&msgcheck=1),
|
|
desc=Valid libref refresh completes for admin user,
|
|
outds=work.test_results
|
|
)
|
|
|
|
/**
|
|
* dump results to the log for offline inspection
|
|
*/
|
|
data _null_;
|
|
set work.test_results;
|
|
putlog 'TEST_RESULT_LINE: ' test_result ' - ' test_description;
|
|
run;
|