Testicle cancer or cyst

My left ball goes hard when my penis goes up and I'm unsure why it never has happened before but in the last month or so its started too happen should I get my testicle checked out its not normal its gets really hard.  Is testicle cancer or a cyst dangerous on testicle please respond?