The behaviour of a class of exact tokamak equilibria is investigated in the context of ideal magnetohydrodynamics. The equilibrium solution allows for a general plasma cross-section shape, restricted to systems with essentially flat toroidal current profiles. The spectrum of the eigenmodes is evaluated by extremizing the Lagrangian using a Galerkin procedure. The different branches of the spectrum are appropriately represented by expanding the displacement vector in terms of the eigenfunctions of the corresponding straight limit. The perturbed vacuum field is expressed by a vector potential. The code is applied to various configurations with a fixed and with a free plasma boundary. The influence of ellipticity of the cross-section and of the aspect ratio on the spectrum is discussed.