s3:torture: make use of smb_protocol_types_string() in run_smb2_negprot()
authorStefan Metzmacher <metze@samba.org>
Mon, 19 Jun 2017 19:53:49 +0000 (21:53 +0200)
committerStefan Metzmacher <metze@samba.org>
Thu, 22 Jun 2017 11:07:40 +0000 (13:07 +0200)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/torture/test_smb2.c

index 9368ab3264dc1e723410212a3edcaf80a116955c..297c3abca9f3af8b96f303b82188dd0fb29beca7 100644 (file)
@@ -246,40 +246,12 @@ bool run_smb2_negprot(int dummy)
        }
 
        protocol = smbXcli_conn_protocol(cli->conn);
+       name = smb_protocol_types_string(protocol);
 
-       switch (protocol) {
-       case PROTOCOL_SMB2_02:
-               name = "SMB2_02";
-               break;
-       case PROTOCOL_SMB2_10:
-               name = "SMB2_10";
-               break;
-       case PROTOCOL_SMB2_22:
-               name = "SMB2_22";
-               break;
-       case PROTOCOL_SMB2_24:
-               name = "SMB2_24";
-               break;
-       case PROTOCOL_SMB3_00:
-               name = "SMB3_00";
-               break;
-       case PROTOCOL_SMB3_02:
-               name = "SMB3_02";
-               break;
-       case PROTOCOL_SMB3_10:
-               name = "SMB3_10";
-               break;
-       case PROTOCOL_SMB3_11:
-               name = "SMB3_11";
-               break;
-       default:
-               break;
-       }
-
-       if (name) {
+       if (protocol >= PROTOCOL_SMB2_02) {
                printf("Server supports %s\n", name);
        } else {
-               printf("Server DOES NOT support SMB2\n");
+               printf("Server DOES NOT support SMB2, only %s\n", name);
                return false;
        }