@@ -73,6 +73,13 @@ def assert_quota_committed(quota, dump):
73
73
assert_true (
74
74
dump ['weight_age' ] == quota .weight_age_permil , 'weight_age' , dump )
75
75
76
+
77
+ def assert_migrate_dests_committed (dests , dump ):
78
+ assert_true (dump ['nr_dests' ] == len (dests .dests ), 'nr_dests' , dump )
79
+ for idx , dest in enumerate (dests .dests ):
80
+ assert_true (dump ['node_id_arr' ][idx ] == dest .id , 'node_id' , dump )
81
+ assert_true (dump ['weight_arr' ][idx ] == dest .weight , 'weight' , dump )
82
+
76
83
def main ():
77
84
kdamonds = _damon_sysfs .Kdamonds (
78
85
[_damon_sysfs .Kdamond (
@@ -137,14 +144,8 @@ def main():
137
144
if scheme ['target_nid' ] != - 1 :
138
145
fail ('damos target nid' , status )
139
146
140
- migrate_dests = scheme ['migrate_dests' ]
141
- if migrate_dests ['nr_dests' ] != 0 :
142
- fail ('nr_dests' , status )
143
- if migrate_dests ['node_id_arr' ] != []:
144
- fail ('node_id_arr' , status )
145
- if migrate_dests ['weight_arr' ] != []:
146
- fail ('weight_arr' , status )
147
-
147
+ assert_migrate_dests_committed (_damon_sysfs .DamosDests (),
148
+ scheme ['migrate_dests' ])
148
149
assert_quota_committed (_damon_sysfs .DamosQuota (), scheme ['quota' ])
149
150
assert_watermarks_committed (_damon_sysfs .DamosWatermarks (),
150
151
scheme ['wmarks' ])
0 commit comments