Testing people by way of their love or hatred of Ahlus Sunnah is from the Manhaj of the Salaf.

None hates this except one ignorant of the Manhaj of the Salaf or one who harbours enmity towards people of Sunnah & doesn't want to be exposed by questioning!

Imaam Abu ‘Uthmaan Ismaa’eel as-Saaboonee (‎رحمه الله, died 449H) said: “One of the distinguishing signs of ahlus-Sunnah is their love of the Imaams of the Sunnah, and its Scholars and its helpers and its allies – and likewise their hatred for the Imaams of bid’ah, those who invite to the Hellfire.” [‘Aqeedatus-Salaf As-haab al-Hadeeth (171)]

When innovations became widespread, and the adherents to the Sunnah became few in number, and ahlul-bid’ah claimed they were upon the truth, and would hide their deviation, ahlus-Sunnah would test those who carried doubts.

Sufyaan ath-Thawree (‎رحمه الله, died 161H) said: “Test the people of Mawsil (in Iraaq) with Mu’aafaa ibn ‘Imraan.” [Tahdheeb al-Kamaal (28/153), Siyar (9/82), at-Tahdheeb (10/181)]

Abdur-Rahmaan ibn Mahdee (رحمه الله) said: “The people of Basrah with Ibn `Awn, so if you see a man loving him, then be at ease with him. For the people of Koofah, it is Maalik ibn Mighwal and Zaa’idah ibn Qudaamah, so if you find a man loving him, have hope in his goodness. As for the people of Shaam (Syria, Jordan, etc), it is al-Awzaa’ee (died 157H) and Abu Is-haaq al-Fazaaree. For the people of Hijaaz, it is Maalik ibn Anas (died 179H).” [al-Laalikaa’ee (41), Tareekh Dimashq (7/128)]

Ahmad ibn ‘Abdullaah ibn Yoonus (رحمه الله) said: “Test the people of Mawsil with Mu’aafah ibn ‘Imraan, and if they love him then they are ahlus-Sunnah, and if they hate him then they are ahlul-bid’ah – just as the people of Koofah should be tested with Yahyaa.” [al-Laalikaa’ee (58)]

Ibn Mahdee (رحمه الله) said: “If you see a person of Basrah loving Hammaad ibn Zaid, then he is a person of Sunnah.” [al-Jarh wat-Ta`deel of Ibn Abee Haatim (1/183), al-Laalikaa’ee (38)]

Qutaibah ibn Sa`eed (رحمه الله) said: “If you see a man loving the People of Hadeeth such as: Yahyaa Ibn Sa’eed, ‘Abdur-Rahmaan Ibn Mahdee, Ahmad Ibn Muhammad Ibn Hanbal, Ishaaq Ibn Raahawaih, then he is upon the Sunnah. The one who opposes them, know he is an innovator (mubtadi’).” [al-Laalikaa’ee (59), Sharaf As-haab al-Hadeeth(143)]

And in these times we say: If you find a person loving Ibn Baaz, al-Albaanee, Ibn Uthaimeen, the great scholars of this era (رحمهم الله). And likewise, Saalih al-Fawzaan, Ahmad an-Najmee (رحمه الله), Rabee’ ibn Haadee, Muhammad Amaan al-Jaamee (رحمه الله), Muqbil bin Haadee (رحمه الله), Zayd al-Madkhalee, Ubaid al-Jaabiree (رحمهم الله) and their likes, then know he is a man of Sunnah, for loving them is a distinguishing sign of Ahlus-Sunnah. And having hatred and enmity for them is a distinguishing sign of ahlul-bid’ah.

But is it permissible? Yes See Sharh ‘Aqeedat us-Salaf As-haab al-Hadeeth, (p.347) of Shaikh Rabee’ for the permissibility of such a comment

This is taken: Abu Khadeejahs website