Home | History | Annotate | Download | only in tests

Lines Matching refs:chainName

154 static std::vector<std::string> listIptablesRule(const char *binary, const char *chainName) {
155 std::string command = StringPrintf("%s -w -n -L %s", binary, chainName);
159 static int iptablesRuleLineLength(const char *binary, const char *chainName) {
160 return listIptablesRule(binary, chainName).size();
164 std::string chainName = StringPrintf("netd_binder_test_%u", arc4random_uniform(10000));
175 mNetd->firewallReplaceUidChain(String16(chainName.c_str()), true, uids, &ret);
178 EXPECT_EQ((int) uids.size() + 6, iptablesRuleLineLength(IPTABLES_PATH, chainName.c_str()));
179 EXPECT_EQ((int) uids.size() + 12, iptablesRuleLineLength(IP6TABLES_PATH, chainName.c_str()));
182 mNetd->firewallReplaceUidChain(String16(chainName.c_str()), false, noUids, &ret);
185 EXPECT_EQ(4, iptablesRuleLineLength(IPTABLES_PATH, chainName.c_str()));
186 EXPECT_EQ(4, iptablesRuleLineLength(IP6TABLES_PATH, chainName.c_str()));
190 mNetd->firewallReplaceUidChain(String16(chainName.c_str()), false, uids, &ret);
193 EXPECT_EQ((int) uids.size() + 4, iptablesRuleLineLength(IPTABLES_PATH, chainName.c_str()));
194 EXPECT_EQ((int) uids.size() + 4, iptablesRuleLineLength(IP6TABLES_PATH, chainName.c_str()));
198 mNetd->firewallReplaceUidChain(String16(chainName.c_str()), false, noUids, &ret);
201 EXPECT_EQ(4, iptablesRuleLineLength(IPTABLES_PATH, chainName.c_str()));
202 EXPECT_EQ(4, iptablesRuleLineLength(IP6TABLES_PATH, chainName.c_str()));