Most dealers are going to do a background check on your license before you get behind the wheel; to make sure it's not suspended/revoked. They may ask for insurance, every state has its own rules; usually the cars are insured by the dealer in my state, but the basic requirement for coverage is that the driver has a valid license. The dealer likely won't let an 18-year-old drive any car they wish, but a 30-year-old can, since they probably won't do something stupid in the heat of the moment. (If there is some perk to being older, this is one of them.) Every dealer makes their own rules; there's always going to be a little bit of bias.
For example, if you show up to the Porsche dealer win a Ferrari, they'll give you no trouble for a test drive. But if you show up in a 10-year-old Honda Civic, you might have to sign some paperwork, show proof of insurance, 2 forms of ID, et cetera. Even then, the salesman wants to be sure you're serious about a purchase of that magnitude by asking a few questions. Usually a Porsche salesman has been in the game for a while, so they've heard every trick in the book. There is no law stating that they must allow you to test-drive their cars, as far as I know.
By the way, many ultra-high-end dealers don't have that many new cars to sell; you can test drive, but you're on a waiting list. Case in point was the Audi R8, with it's 2-3 year waiting list; you could not test drive the floor sample. It would have a SOLD sign on it even if there was one...it would stay for about one day or less while it was being preped and detailed. So the way to "test drive" it would be to join one of the Audi-sponsored driving/racing schools that featured the R8. If you were going to spend that sort of coin, you were probably willing to buy the car; which meant paying for the car in full in most cases.
As for other high-end cars, or limited edition cars (where each dealer migh only have one on the lot, or only getting one or two for sale), in many cases, you may not be able to test drive it: It's probably already sold! Lots of people put a deposit on it so that it's there when they pick it up. Sometimes the people in the dealership purchase it, or the owner's son is going drive it away soon. Sometimes the car is there to draw you in; but that's usually only if a car is brand-new (for example, the first 2-3 weeks). Otherwise, you have look and act as if you're interested in buying it, not just driving it for giggles.
A little bit more down to earth, most dealerships of the more popular brands will allow nearly anyone to test drive; basically, if you came into the dealer with a car that runs, and doesn't smoke too badly, you'll be allowed to drive, as long as you don't scare them silly beforehand. And if you come into the service department's driveway with your car, and then head over to sales, it's even easier. They know your car isn't going anywhere...it's going to be on a lift for a while! On the other hand, the paperwork trail is usually much shorter (or even non-existent). The dealer has an approved test drive area or route, and you can't always deviate without prior approval.
Don't forget your wallet; but don't test drive a car from a place that asks for money during a test-drive. Go alone, your buddy can wait in the lobby while you test drive. Try the lesser-powered car before daring to ask for the V8 powered one. A test drive is not a performance analysis in most cases. The salesman isn't impressed with you revving the motor to 5000 rpm, he/she may be a car nut, but they're not impressed with show-offs. If you know the "performance stats" of the car, then there's nothing to really prove. Besides, you want to make sure its a car you want to live with in basic stop-and-go traffic.
Don't dress like a slob, and don't give them the sob-story; I got just as sick and tired of the rich snobs who thought they were at the Ritz-Carlton as the "nice-guy millionaire" who'd wear tatters and old sandals with a 3-day-old beard...who subsequently cried he wasn't getting any attention from the salesman! Also, if you act as if you're "too good" for the brand, you'll also be ignored. Letting anyone drive their new cars, regardless of make/model, is a sign of respect. Acting like your above them and their products is just stupid and impresses nobody.
Anyhow, this is so far off-topic, it hurts.