From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id 44BF06EC58; Sat, 20 Feb 2021 14:21:19 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 44BF06EC58 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1613820079; bh=+hsCrcABm92OVyU2JBYtMda2gPK5YN/4KLqH9RXFUSY=; h=To:References:Date:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=JND1N83AQdR1Ort+B+Ywfv3F12sIUT7DdvYyCVcTlyWSkjeIV28eHoG/D46rQWdTP Ha1sT5tlryUIB+ct2t7MeLuvyDZHGj8DWYlWvC1vDnxk6yLGig0ddTUVyTBNPotq70 PfZZyqtR91N5zHl19tB+ONT9m0sgJN40qJ498yqE= Received: from smtp40.i.mail.ru (smtp40.i.mail.ru [94.100.177.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id C1A656EC58 for ; Sat, 20 Feb 2021 14:21:17 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org C1A656EC58 Received: by smtp40.i.mail.ru with esmtpa (envelope-from ) id 1lDQK4-0005pK-Pr; Sat, 20 Feb 2021 14:21:17 +0300 To: Sergey Bronnikov , Alexander Turenko References: <7a1f0cb7a97b41b3cde25ac5d2c591a84aa13f0b.1613674486.git.artemreyt@tarantool.org> Message-ID: <77565553-c787-e953-e275-c4a4ce0b8a74@tarantool.org> Date: Sat, 20 Feb 2021 14:21:16 +0300 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: ru X-7564579A: 78E4E2B564C1792B X-77F55803: 4F1203BC0FB41BD975C3EC174F56692242B8E6687D03D8974314021AB65B8FCC182A05F5380850408CCD71DB788B0772C407BE253AD4CE846A89B6B6F7167065382C6F2EBEA1713A X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7387B291F9AC4D188EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F790063798FF8892961A0B3C8638F802B75D45FF5571747095F342E8C7A0BC55FA0FE5FC051190C899382BF8DB1C4808E15099C316E2D4BF9E08A661389733CBF5DBD5E913377AFFFEAFD269176DF2183F8FC7C0998E19D2343267C68941B15DA834481FCF19DD082D7633A0EF3E4896CB9E6436389733CBF5DBD5E9D5E8D9A59859A8B6F7EC8CC465A83DA3CC7F00164DA146DA6F5DAA56C3B73B237318B6A418E8EAB8D32BA5DBAC0009BE9E8FC8737B5C2249D04BB991E368DC2C76E601842F6C81A12EF20D2F80756B5F7E9C4E3C761E06A776E601842F6C81A127C277FBC8AE2E8B1430382131542CB93AA81AA40904B5D9DBF02ECDB25306B2B25CBF701D1BE8734AD6D5ED66289B5278DA827A17800CE7BEE702378D8A34C767F23339F89546C5A8DF7F3B2552694A6FED454B719173D6725E5C173C3A84C3FE621C1A6B846BFC35872C767BF85DA2F004C906525384306FED454B719173D6462275124DF8B9C9DE2850DD75B2526BE5BFE6E7EFDEDCD789D4C264860C145E X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A24A6D60772A99906F8E1CD14B953EB46DBA9665A77460462F355D89D7DBCDD132 X-C1DE0DAB: 0D63561A33F958A558CBEEEB1BDE039C19071EB2D10B42B8B290EB161DA2D2ECD59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA75448CF9D3A7B2C848410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D348BF433665406F39042BA036700C2A36DC62D130772EC712C01E9D77B68EA299867FBC6E798FB4C8A1D7E09C32AA3244CE1595A21154220E664137BECBF5B162A3A76366E8A9DE7CA927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2bioj2CfMKaWP9xtTQzHxnkgcew== X-Mailru-Sender: 65CD03CFE33A0EC7E4F6C6702325C42782CAF2F73527E1454C50AA54F1216D8D22AB40DADB841338B08A37556DE0CB7BB7E364AFDB3F206FD953F29DB7D76D89B1E6F68DAE724AB9112434F685709FCF0DA7A0AF5A3A8387 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCHv2 1/2] core: add setting error injections via env X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Artem via Tarantool-patches Reply-To: Artem Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Hello, thanks for the review! >> + >> +void errinj_set_with_environment_vars() { >> +    for (enum errinj_id i = 0; i < errinj_id_MAX; i++) { >> +        struct errinj *inj = &errinjs[i]; >> +        const char *env_value = getenv(inj->name); >> +        if (!env_value || *env_value == '\0') >> +            continue; >> + >> +        if (inj->type == ERRINJ_INT) { >> +            char *end; >> +            int64_t int_value = strtoll(env_value, &end, 10); >> +            if (*end == '\0') >> +                inj->iparam = int_value; >> +        } else if (inj->type == ERRINJ_BOOL) { >> +            if (strcmp(env_value, "false") == 0 || strcmp(env_value, >> "FALSE") == 0) > > 1. What happen if someone set boolean value to "False"? > > May be it's worth to convert env_value to lowercase and then compare? > The same question for "true". 1. Done. Case-insensetive value can be set to env variable now. >> +-- Execute errinj_set_with_enviroment_vars_script.lua >> +-- via tarantool with presetted environment variables. >> +local TARANTOOL_PATH = arg[-1] >> +local set_env_str = 'ERRINJ_TESTING=true ERRINJ_WAL_WRITE_PARTIAL=1 >> ERRINJ_VY_READ_PAGE_TIMEOUT=2.5' >> +local script_file = fio.pathjoin( > > 2. variable name should reflect a purpose of variable. > > name is about script file, when variable contains a path to a file. 2. Done. Renamed to path_to_test_file.