[PATCH v2 compass-ci] params_group.rb: delete $user if tbox_group has

Some tbox_groups have $user in es. Such as vm-2p8g--$user or vm-2p8g.$user. But their config is the same, they should be compared together. Signed-off-by: Li Yuanchao <lyc163mail@163.com> --- lib/params_group.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/params_group.rb b/lib/params_group.rb index cde40af..57cd5c1 100644 --- a/lib/params_group.rb +++ b/lib/params_group.rb @@ -67,10 +67,15 @@ def filter_groups(groups) end end +def get_tbox_group(tbox_group) + return tbox_group.gsub(/(--|\.).*$/, '') +end + def get_all_params(job) all_params = {} job.each_key do |param| all_params[param] = job[param] if COMMON_PARAMS.include?(param) + all_params[param] = get_tbox_group(job[param]) if param == 'tbox_group' next unless param == 'pp' pp_params = get_pp_params(job[param]) -- 2.23.0

On Wed, Dec 02, 2020 at 04:26:20PM +0800, Li Yuanchao wrote:
Some tbox_groups have $user in es. Such as vm-2p8g--$user or vm-2p8g.$user. But their config is the same, they should be compared together.
Signed-off-by: Li Yuanchao <lyc163mail@163.com> --- lib/params_group.rb | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/lib/params_group.rb b/lib/params_group.rb index cde40af..57cd5c1 100644 --- a/lib/params_group.rb +++ b/lib/params_group.rb @@ -67,10 +67,15 @@ def filter_groups(groups) end end
+def get_tbox_group(tbox_group) + return tbox_group.gsub(/(--|\.).*$/, '')
some tbox_groups like vm-2p8g.taishan200-2280-2s48p-256g--a1-8 will return vm-2p8g, is it ok? Thanks, Ping
+end + def get_all_params(job) all_params = {} job.each_key do |param| all_params[param] = job[param] if COMMON_PARAMS.include?(param) + all_params[param] = get_tbox_group(job[param]) if param == 'tbox_group' next unless param == 'pp'
pp_params = get_pp_params(job[param]) -- 2.23.0

On Wed, Dec 02, 2020 at 04:49:56PM +0800, Li Ping wrote:
On Wed, Dec 02, 2020 at 04:26:20PM +0800, Li Yuanchao wrote:
Some tbox_groups have $user in es. Such as vm-2p8g--$user or vm-2p8g.$user. But their config is the same, they should be compared together.
Signed-off-by: Li Yuanchao <lyc163mail@163.com> --- lib/params_group.rb | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/lib/params_group.rb b/lib/params_group.rb index cde40af..57cd5c1 100644 --- a/lib/params_group.rb +++ b/lib/params_group.rb @@ -67,10 +67,15 @@ def filter_groups(groups) end end
+def get_tbox_group(tbox_group) + return tbox_group.gsub(/(--|\.).*$/, '')
some tbox_groups like vm-2p8g.taishan200-2280-2s48p-256g--a1-8 will return vm-2p8g, is it ok?
I think so. In fact, the method get_hosts_file in file lkp-tests/lib/job.rb has did so: 369 hosts_file_name = @job['tbox_group'].split(/\.|--/)[0] Thanks, Yuanchao

On Wed, Dec 02, 2020 at 05:06:40PM +0800, Li Yuanchao wrote:
On Wed, Dec 02, 2020 at 04:49:56PM +0800, Li Ping wrote:
On Wed, Dec 02, 2020 at 04:26:20PM +0800, Li Yuanchao wrote:
Some tbox_groups have $user in es. Such as vm-2p8g--$user or vm-2p8g.$user. But their config is the same, they should be compared together.
Signed-off-by: Li Yuanchao <lyc163mail@163.com> --- lib/params_group.rb | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/lib/params_group.rb b/lib/params_group.rb index cde40af..57cd5c1 100644 --- a/lib/params_group.rb +++ b/lib/params_group.rb @@ -67,10 +67,15 @@ def filter_groups(groups) end end
+def get_tbox_group(tbox_group) + return tbox_group.gsub(/(--|\.).*$/, '')
some tbox_groups like vm-2p8g.taishan200-2280-2s48p-256g--a1-8 will return vm-2p8g, is it ok?
I think so. In fact, the method get_hosts_file in file lkp-tests/lib/job.rb has did so:
369 hosts_file_name = @job['tbox_group'].split(/\.|--/)[0]
maybe you find a new patch. I think we should keep all the configuration information of the test machine. Thanks, Ping
Thanks, Yuanchao
participants (2)
-
Li Ping
-
Li Yuanchao