I think the patch is going too far. I believe the intention of the test is to run some httpfs commands as a generic user via curl and then verify the codes (that's where the bug needs to be fixed). However, removing shHDFS seems like an overreach, as the cleanup needs to be done as the owner of the directories. These two users can be different hence the need for two different shell objects.
Your patch only needs to address the asserts part in lines 101, 111, 134, 145, 148