Skip to content

Commit

Permalink
debug/temporary: cat outfile and dmesg in t4010
Browse files Browse the repository at this point in the history
Also reload s-f-feasibility during resource load
  • Loading branch information
jacobtkeio committed Dec 27, 2024
1 parent c131a44 commit c93a773
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 9 deletions.
4 changes: 3 additions & 1 deletion resource/modules/resource_match_opts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,6 @@ resource_opts_t &resource_opts_t::operator+= (const resource_opts_t &src)
bool resource_opts_t::operator() (const std::string &k1, const std::string &k2) const
{
if (m_tab.find (k1) == m_tab.end () || m_tab.find (k2) == m_tab.end ())
return k1 < k2;
return m_tab.at (k1) < m_tab.at (k2);
}

Expand Down Expand Up @@ -509,6 +508,9 @@ int resource_opts_t::parse (const std::string &k, const std::string &v, std::str

case static_cast<int> (resource_opts_key_t::LOAD_ALLOWLIST):
m_resource_prop.set_load_allowlist (v);
info += k;
info += "; ";
info += v;
break;

case static_cast<int> (resource_opts_key_t::MATCH_POLICY):
Expand Down
26 changes: 18 additions & 8 deletions t/t4010-match-conf.t
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ start_resource () {
"flux module reload -f sched-fluxion-resource ${RESOURCE_OPTIONS} && "\
"flux module reload -f sched-fluxion-qmanager && "\
"flux module stats sched-fluxion-qmanager && "\
"flux ion-resource params >${outfile}"
"flux module reload -f sched-fluxion-feasibility ${RESOURCE_OPTIONS} && "\
"flux ion-resource params >${outfile} && "\
"flux dmesg"
}
start_resource_noconfig () {
local outfile=$1; shift
Expand All @@ -34,7 +36,9 @@ start_resource_noconfig () {
"flux module reload -f sched-fluxion-resource ${RESOURCE_OPTIONS} && "\
"flux module reload -f sched-fluxion-qmanager && "\
"flux module stats sched-fluxion-qmanager && "\
"flux ion-resource params >${outfile}"
"flux module reload -f sched-fluxion-feasibility ${RESOURCE_OPTIONS} && "\
"flux ion-resource params >${outfile} && "\
"flux dmesg"
}
check_load_file(){
test $(jq '.params."load-file"' ${1}) = ${2}
Expand Down Expand Up @@ -71,7 +75,8 @@ test_expect_success 'resource: sched-fluxion-resource loads with no config' '
check_match_format ${outfile} "\"rv1_nosched\"" &&
check_match_subsystems ${outfile} "\"containment\"" &&
check_reserve_vtx_vec ${outfile} 0 &&
check_prune_filters ${outfile} "\"ALL:core\""
check_prune_filters ${outfile} "\"ALL:core\"" &&
cat ${outfile}
'

test_expect_success 'resource: sched-fluxion-resource loads with valid toml' '
Expand All @@ -85,7 +90,8 @@ test_expect_success 'resource: sched-fluxion-resource loads with valid toml' '
check_match_format ${outfile} "\"rv1_nosched\"" &&
check_match_subsystems ${outfile} "\"containment\"" &&
check_reserve_vtx_vec ${outfile} 200000 &&
check_prune_filters ${outfile} "\"ALL:core,ALL:gpu\""
check_prune_filters ${outfile} "\"ALL:core,ALL:gpu\"" &&
cat ${outfile}
'

test_expect_success 'resource: module load options take precedence' '
Expand All @@ -100,7 +106,8 @@ test_expect_success 'resource: module load options take precedence' '
check_match_format ${outfile} "\"rv1\"" &&
check_match_subsystems ${outfile} "\"containment\"" &&
check_reserve_vtx_vec ${outfile} 200000 &&
check_prune_filters ${outfile} "\"ALL:core,ALL:gpu\""
check_prune_filters ${outfile} "\"ALL:core,ALL:gpu\"" &&
cat ${outfile}
'

test_expect_success 'resource: sched-fluxion-resource loads with no keys' '
Expand All @@ -114,7 +121,8 @@ test_expect_success 'resource: sched-fluxion-resource loads with no keys' '
check_match_format ${outfile} "\"rv1_nosched\"" &&
check_match_subsystems ${outfile} "\"containment\"" &&
check_reserve_vtx_vec ${outfile} 0 &&
check_prune_filters ${outfile} "\"ALL:core\""
check_prune_filters ${outfile} "\"ALL:core\"" &&
cat ${outfile}
'

test_expect_success 'resource: sched-fluxion-resource loads with extra keys' '
Expand All @@ -128,14 +136,16 @@ test_expect_success 'resource: sched-fluxion-resource loads with extra keys' '
check_match_format ${outfile} "\"rv1_nosched\"" &&
check_match_subsystems ${outfile} "\"containment\"" &&
check_reserve_vtx_vec ${outfile} 200000 &&
check_prune_filters ${outfile} "\"ALL:core,ALL:gpu\""
check_prune_filters ${outfile} "\"ALL:core,ALL:gpu\"" &&
cat ${outfile}
'

test_expect_success 'resource: load must tolerate an invalid policy' '
conf_name="09-invalid-policy" &&
outfile=${conf_name}.out &&
start_resource ${conf_base}/${conf_name} ${outfile} &&
check_match_policy ${outfile} "\"first\""
check_match_policy ${outfile} "\"first\"" &&
cat ${outfile}
'

test_expect_success 'resource: load must fail on a bad value' '
Expand Down

0 comments on commit c93a773

Please sign in to comment.