From 132321aa62e8664de370a42b75b12d1bdec6567d Mon Sep 17 00:00:00 2001
From: Moe Jette <jette1@llnl.gov>
Date: Wed, 9 Feb 2005 00:26:54 +0000
Subject: [PATCH] --test-only takes precidence over --batch option

---
 src/srun/srun.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/srun/srun.c b/src/srun/srun.c
index 2a9c073a980..1a0e077d3b8 100644
--- a/src/srun/srun.c
+++ b/src/srun/srun.c
@@ -134,12 +134,7 @@ int srun(int ac, char **av)
 	/* now global "opt" should be filled in and available,
 	 * create a job from opt
 	 */
-	if (opt.batch) {
-		if (_run_batch_job() < 0)
-			exit (1);
-		exit (0);
-
-	} else if (opt.test_only) {
+	if (opt.test_only) {
 		int rc = allocate_test();
 		if (rc) {
 			slurm_perror("allocation failure");
@@ -148,6 +143,11 @@ int srun(int ac, char **av)
 		info("allocation success");
 		exit (0);
 
+	} else if (opt.batch) {
+		if (_run_batch_job() < 0)
+			exit (1);
+		exit (0);
+
 	} else if (opt.no_alloc) {
 		info("do not allocate resources");
 		sig_setup_sigmask();
-- 
GitLab