We propose the cyclic permutation test to test general linear hypotheses for linear models. The test is nonrandomized and valid in finite samples with exact Type I error α for an arbitrary fixed design matrix and arbitrary exchangeable errors, whenever 1/α is an integer and n/p⩾1/α−1, where n is the sample size and p is the number of parameters. The test involves applying the marginal rank test to 1/α linear statistics of the outcome vector, where the coefficient vectors are determined by solving a linear system such that the joint distribution of the linear statistics is invariant with respect to a nonstandard cyclic permutation group under the null hypothesis. The power can be further enhanced by solving a secondary nonlinear travelling salesman problem, for which the genetic algorithm can find a reasonably good solution. Extensive simulation studies show that the cyclic permutation test has comparable power to existing tests. When testing for a single contrast of coefficients, an exact confidence interval can be obtained by inverting the test.