Skip to content

Commit

Permalink
Merge pull request #1009 from dpino/fix-property-based-pr
Browse files Browse the repository at this point in the history
Fix property-based test stall
  • Loading branch information
dpino committed Jan 15, 2018
2 parents b643c37 + ea5228c commit f521c1d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 20 deletions.
20 changes: 3 additions & 17 deletions src/program/lwaftr/tests/propbased/genyang.lua
Expand Up @@ -36,26 +36,11 @@ function generate_any(pid, schema)
-- leaf-list cases (for remove, we need a case with a selector too)
-- Note: this assumes a list or leaf-list case exists in the schema at all
elseif cmd == "add" then
local query, val, schema
local ok = false
while not ok do
query, val, schema = generate_config_xpath_and_val(schema)
if string.match(tostring(val), "^{.*}$") then
ok = true
end
end
--local query, val, schema = generate_config_xpath_and_val(schema)
local query, val, schema = generate_config_xpath_and_val(schema)
return string.format("./snabb config add -s %s %s \"%s\" \"%s\"",
schema, pid, query, val)
else
local query, val, schema
local ok = false
while not ok do
query, val, schema = generate_config_xpath_and_val(schema)
if string.match(query, "[]]$") then
ok = true
end
end
local query, val, schema = generate_config_xpath_and_val(schema)
return string.format("./snabb config remove -s %s %s \"%s\"",
schema, pid, query)
end
Expand Down Expand Up @@ -297,6 +282,7 @@ local function generate_xpath_and_node_info(schema, for_state)
if handler then handler(node) end
end
local function visit_body(node)
if not node then return end
local ids = {}
for id, node in pairs(node.body) do
-- only choose nodes that are used in configs unless
Expand Down
5 changes: 2 additions & 3 deletions src/program/lwaftr/tests/subcommands/run_test.py
Expand Up @@ -22,9 +22,8 @@ class TestRun(BaseTestCase):
)

def test_run(self):
output = self.run_cmd(self.cmd_args)
self.assertIn(b'link report', output,
b'\n'.join((b'OUTPUT', output)))
output = self.run_cmd(self.cmd_args).decode(ENC)
self.assertIn("Migrating instance", output)

def test_run_on_a_stick_migration(self):
# The LwAFTR should be abel to migrate from non-on-a-stick -> on-a-stick
Expand Down

0 comments on commit f521c1d

Please sign in to comment.