When there is a kidney infection going on, the urine tests and/or blood tests should be positive for certain bacteria.
Along with abdominal pain and back pain, kidney infection attack is accompanied with fever at least lasting for 2 days, shivering, vomiting, nausea, diarrhea, frequent urination, painful urination, cloudy urine, blood in urine, urine with strange odor, sweating, weakness, and pains all over the body.
My opinion is that you are having only a IBS case.
Besides, lower abdominal pains and altered bowel movements, IBS is manifested also with back pain, difficulties with digestion food, heartburn, nausea, vomiting, sexual dysfunction (including painful intercourse and poor libido), and urinary frequency and urgency.
You may notice worsening of this symptoms in your premenstrual period, during stress and when eating certain foods.
Best wishes!
Marija