There isn't really a "test", per se, to tell if a bread is a "real sourdough" or not. Without getting overly technical, the tangy "sour" is created by a lactobacillus (bacteria) culture feeding on the byproducts of the yeast used to make the dough rise. The byproducts of the bacteria produce the lactic acids which give the resulting bread its sour taste.
The taste of sourdough can be simulated by adding other acidic components to the bread dough. Practically speaking, the only way to tell the difference is if you have the experience of a refined palate that you recognize the taste difference.
Ah, but here's the tricky part. Once a baker has a stable culture of yeast and bacteria (starter), they'll save a bit of the fermented dough to add to the next batch, and so on for batch after batch. It is not unusual for bakers to continue their culture for years or even decades. So the problem of recognizing the authenticity of sourdough is that each bakers' sourdough will have it's own distinctive taste. Yikes. So much for the standard taste test.
There is one test I can think of; although, I don't know how practical this is: A very "healthy" sour dough culture is the result of having reached a really stable and balanced, symbiotic relationship between the yeast and bacteria. This is desirable because it prevents other undesirable bacteria from setting up shop. Because of this inherent stability, real sourdough breads are very resistant to mold and other reactions that cause them to go bad. So, if your sourdough bread seems to last longer then you would expect from fresh bread, that might be a good indication of real sourdough. Of course, this can also be the result of preservatives added to the bread; so… no help there.