chris brown (boxing pose)*Chris Brown is facing a test this weekend and if he mucks it up, there will be severe consequences.

Brown is being allowed to leave rehab, where he is essentially in lockdown, to attend a charity event. But, if he steps out of line, the rehab facility will kick him to the curb and that won’t be good.

According to TMZ, Brown was able to get permission to attend the 3-hour celebrity toy drive event on Melrose Avenue Sunday in West Hollywood because the rehab facility — where he’s getting help for anger management — thought the experience would be good for his treatment.

But sources also say the rehab facility in Malibu is keeping him on an extremely tight leash during the excursion.

Chris only has permission to attend the event from 1pm to 4pm and as soon as it’s over, he has to skedaddle it back to rehab. The facility is giving him just enough extra time to travel to and from West Hollywood, but that’s it. That means absolutely NO time to hang with friends before or after the event.

If he’s late to rehab Sunday evening, Chris is out … which would be real bad … because rehab’s the main reason he’s not in jail right now. You’ll recall, the judge in his Rihanna beating case revoked his probation, but decided not to toss him in the pokey because he was making good progress in treatment.

It’s being reported that the rehab facility will also be drug testing Brown upon his return … just in case he thinks he can somehow sneak some smoke.

Tough, tough love. Sounds like just what he needs.