I'm trying to figure out a way to test hypotheses about variance in the linear regression model. The hypotheses I want to test are: \begin{align*} &H_0:\sigma^2=1\\ &H_1:\sigma^2<1 \end{align*}
The linear regression model is given by $$Y_i=aX_i+b+\varepsilon_i,\quad i=\overline{1,n}$$ where $\varepsilon_i\in\mathcal{N}(0,\sigma^2)$ are independent random variables. If $\hat{a},\hat{b}$ are least-square estimates of $a,b$, then the least-square estimate of $\sigma^2$ is: $$\hat{\sigma^2}=\frac{1}{n-2}\sum_{j=1}^n(Y_j-\hat{a}X_j-\hat{b})^2$$ Based on the conversation in this thread, $$Z(X)=\frac{(n-2)\hat{\sigma^2}}{\sigma^2}\in\chi^2({n-2})$$ but it depends on $\sigma^2$ as a function and is not a statistic. However, its distribution is $\chi^2_{n-2}$ no matter the value of $\sigma^2$. I try to find a confidence interval for $\sigma^2$ and a given statistical significance $\alpha$.
I need to find $\sigma_a^2,\sigma_b^2:$ $$\mathbb{P}_0(\sigma_a^2\leq\sigma^2\leq\sigma_b^2)=\mathbb{P}_0(\chi^2_{\alpha}({n-2})\leq Z\leq\chi^2_{(1-\alpha)}(n-2))=1-\alpha$$ Using the expression for $Z$ to transform the inequalities I get: $$\mathbb{P}_0(\sigma_a^2\leq\sigma^2\leq\sigma_b^2)=\mathbb{P}_0(\frac{(n-2)\hat{\sigma^2}}{\chi^2_{(1-\alpha)}}\leq \sigma^2\leq\frac{(n-2)\hat{\sigma^2}}{\chi^2_{\alpha}})=1-\alpha$$ which explicitly gives the borders of an interval.
My question is, can I use this for interval for hypothesis testing? If not, how do I test hypotheses for $\sigma^2$? Is there a better way to do it?