You can testify, plea the 5th amendment and not say a word (if it can incriminate you). However, if the prosecution offers your use immunity, than, you may be forced to testify against him.
Mr. Zarabi is right again. Although you have served your time on whatever you were sentenced for your testimony could still incriminate you on other issues. Take the 5th and ask for an attorney if you are called to the stand.
As part of your plea agreement, did the DA place any conditions about testifying? If you have already been sentenced, then the DA can not penalize you for the sentenced case, however, you can be served with a subpoena to testify. You should consult with an attorney as to what all your options are.