my mac pro 3,1 (2008) opens the dvd tray every time i close it. The open button on the keyboard works, and even if i disconnect the keyboard the tray still open
it's like i'm pushing the keyboard eject button all the time, but it didn't show the icon in the screen, only show the icon when i push the keyboard eject button.
It sounds like either the DVD drive is faulty or isn't properly installed. I'd pull it out of the computer and see if it continues to open and close when it's not installed but still connected to the computer.