diff --git a/testsuite/expect/test31.2 b/testsuite/expect/test31.2
index d22b111430ee1d2911aa7d466c4dbb2c990b8ebd..2e5fc5e0bd99c7e97f93c8872c1c8af64ec06a3d 100755
--- a/testsuite/expect/test31.2
+++ b/testsuite/expect/test31.2
@@ -148,8 +148,10 @@ expect {
 	}
 }
 
+exec $bin_sed -i {s/^\(Prolog=\)/#\1/gI} $config_dir/slurm.conf
+
 # Append Prolog config to the slurm.conf
-exec $bin_echo "prolog=$cwd/$good_prolog" >> $config_dir/slurm.conf
+exec $bin_echo "Prolog=$cwd/$good_prolog" >> $config_dir/slurm.conf
 update_conf
 
 spawn $sbatch -t1 -N1 -w$test_node --exclusive -o/dev/null $test_script
@@ -211,8 +213,10 @@ expect {
 	}
 }
 
+exec $bin_sed -i {s/^\(Prolog=\)/#\1/gI} $config_dir/slurm.conf
+
 # Append Prolog config to the slurm.conf
-exec $bin_echo "prolog=$cwd/$bad_prolog" >> $config_dir/slurm.conf
+exec $bin_echo "Prolog=$cwd/$bad_prolog" >> $config_dir/slurm.conf
 update_conf
 
 spawn $sbatch -t1 -N1 -w$test_node --exclusive -o/dev/null $test_script