s4-smbtorture: paranoia check for architectures in request and reply for enumdrivers...
authorGünther Deschner <gd@samba.org>
Mon, 13 Dec 2010 14:46:05 +0000 (15:46 +0100)
committerGünther Deschner <gd@samba.org>
Tue, 14 Dec 2010 21:42:17 +0000 (22:42 +0100)
Guenther

source4/torture/rpc/spoolss.c

index 26e53eb2524b8eda6d17b3f809440a3f19d80134..925b703dd7f41ede1bcf0ce9a52bfefdf2356a53 100644 (file)
@@ -569,6 +569,7 @@ static bool test_EnumPrinterDrivers_findone(struct torture_context *tctx,
        uint32_t count;
        union spoolss_DriverInfo *info;
        int i;
+       const char *environment_ret = NULL;
 
        torture_assert(tctx,
                test_EnumPrinterDrivers_args(tctx, b, server_name, environment, level, &count, &info),
@@ -582,28 +583,37 @@ static bool test_EnumPrinterDrivers_findone(struct torture_context *tctx,
                        break;
                case 2:
                        driver_name_ret = info[i].info2.driver_name;
+                       environment_ret = info[i].info2.architecture;
                        break;
                case 3:
                        driver_name_ret = info[i].info3.driver_name;
+                       environment_ret = info[i].info3.architecture;
                        break;
                case 4:
                        driver_name_ret = info[i].info4.driver_name;
+                       environment_ret = info[i].info4.architecture;
                        break;
                case 5:
                        driver_name_ret = info[i].info5.driver_name;
+                       environment_ret = info[i].info5.architecture;
                        break;
                case 6:
                        driver_name_ret = info[i].info6.driver_name;
+                       environment_ret = info[i].info6.architecture;
                        break;
                case 7:
                        driver_name_ret = info[i].info7.driver_name;
                        break;
                case 8:
                        driver_name_ret = info[i].info8.driver_name;
+                       environment_ret = info[i].info8.architecture;
                        break;
                default:
                        break;
                }
+               if (environment_ret) {
+                       torture_assert_str_equal(tctx, environment, environment_ret, "architecture mismatch");
+               }
                if (strequal(driver_name, driver_name_ret)) {
                        return true;
                }