Menstrual blood touching INTACT skin during frottage poses no HIV transmission risk. If it comes into contact with broken skin or is swallowed, then HIV transmission is possible but unlikely. Since there was no penetration, and you did not mention oral sex, you did not have a risk and do not need to test. As for the "bacterial" infection on your testicles following this encounter, I recommend you consult your doctor, but this is NOT related to HIV.
As far as the second encounter goes, you wore a condom which apparently did not come off during sex even though your penis was "weak," nor did it break. You had no risk and do not need to test.
Neither encounter, as you explained them, put you at risk. Too be safe, if you are going to engage in naked frottage, I recommend wearing a condom. "Things" happen in the heat of the moment and it's better to be safe than sorry.
As for your other issues of rash, skin sores and pimples on your body and chest......I again recommend seeing your doctor. We can not diagnose this forum.
I'll just go ahead and share my answer too although you've already gotten full information. Just backing up what was said.
The first relationship is what worries you? The rubbing of penis on vagina with menstruation? That's not a risk. Air inactivates the virus. They have studied HIV thoroughly at this point to understand it and that is not going to be a risk. The second situation was with condom which also makes it not a risk. You have nothing to worry about with regards to HIV and do not need to test. Unless you have unprotected vaginal or anal penetrating sex or share IV drug needles, you do not need to worry about HIV.