diff options
Diffstat (limited to 'tools')
| -rwxr-xr-x | tools/generate-docs-nm-property-infos.py | 59 | ||||
| -rwxr-xr-x | tools/run-nm-test.sh | 12 | ||||
| -rwxr-xr-x | tools/test-networkmanager-service.py | 6 |
3 files changed, 39 insertions, 38 deletions
diff --git a/tools/generate-docs-nm-property-infos.py b/tools/generate-docs-nm-property-infos.py index 41349e6d..25aa272a 100755 --- a/tools/generate-docs-nm-property-infos.py +++ b/tools/generate-docs-nm-property-infos.py @@ -54,27 +54,29 @@ def scan_doc_comments(plugin, setting_node, file, start_tag, end_tag): return +keywords = [ + "property", + "variable", + "format", + "values", + "default", + "example", + "description", + "description-docbook", +] +kwd_first_line_re = re.compile( + r"^\s*\**\s+({}):\s+(.*?)\s*$".format("|".join(keywords)) +) +kwd_more_line_re = re.compile(r"^\s*\**\s+(.*?)\s*$") + + def process_data(data): parsed_data = {} if not data: return parsed_data - keywords = [ - "property", - "variable", - "format", - "values", - "default", - "example", - "description", - "description-docbook", - ] - kwd_pat = "|".join(keywords) keyword = "" for line in data: - kwd_first_line_found = re.search( - r"^\s*\**\s+({}):\s+(.*?)\s*$".format(kwd_pat), line - ) - kwd_more_line_found = re.search(r"^\s*\**\s+(.*?)\s*$", line) + kwd_first_line_found = kwd_first_line_re.search(line) if kwd_first_line_found: keyword = kwd_first_line_found.group(1) if keyword == "description-docbook": @@ -82,16 +84,17 @@ def process_data(data): else: value = kwd_first_line_found.group(2) + " " parsed_data[keyword] = value - elif kwd_more_line_found: + continue + kwd_more_line_found = kwd_more_line_re.search(line) + if kwd_more_line_found: if not keyword: print("Extra mess in a comment: %s" % (line)) exit(1) + if keyword == "description-docbook": + value = kwd_more_line_found.group(1) + "\n" else: - if keyword == "description-docbook": - value = kwd_more_line_found.group(1) + "\n" - else: - value = kwd_more_line_found.group(1) + " " - parsed_data[keyword] += value + value = kwd_more_line_found.group(1) + " " + parsed_data[keyword] += value for keyword in keywords: if keyword == "variable" and keyword not in parsed_data: parsed_data[keyword] = parsed_data["property"] @@ -120,18 +123,6 @@ def write_data(setting_node, parsed_data): property_node.append(des) -def pretty_xml(element, newline, level=0): - if element: - if (element.text is None) or element.text.isspace(): - element.text = newline - else: - element.text = newline + element.text.strip() + newline - temp = list(element) - for subelement in temp: - subelement.tail = newline - pretty_xml(subelement, newline, level=level + 1) - - if len(sys.argv) < 4: print("Usage: %s [plugin] [output-xml-file] [srcfiles]" % (sys.argv[0])) exit(1) @@ -149,6 +140,4 @@ for one_file in source_files: setting_node.text = "\n" scan_doc_comments(plugin, setting_node, one_file, start_tag, end_tag) -pretty_xml(root_node, "\n") - ET.ElementTree(root_node).write(output) diff --git a/tools/run-nm-test.sh b/tools/run-nm-test.sh index 230a7a66..59a48933 100755 --- a/tools/run-nm-test.sh +++ b/tools/run-nm-test.sh @@ -37,6 +37,7 @@ usage() { echo " --no-libtool: when running with valgrind, the script tries automatically to" echo " use libtool as necessary. This disables libtool usage" echo " --make-first|-m: before running the test, make it (only works with autotools build)" + echo " --no-make-first|-M: disable --make-first option" echo " --valgrind|-v: run under valgrind" echo " --no-valgrind|-V: disable running under valgrind (overrides NMTST_USE_VALGRIND=1)" echo " -d: set NMTST_DEBUG=d" @@ -165,6 +166,10 @@ else NMTST_MAKE_FIRST=1 shift ;; + --no-make-first|-M) + NMTST_MAKE_FIRST=0 + shift + ;; "--valgrind"|-v) NMTST_USE_VALGRIND=1 shift; @@ -295,9 +300,10 @@ fi if ! _is_true "$NMTST_USE_VALGRIND" 0; then export NM_TEST_UNDER_VALGRIND=0 - exec "${NMTST_DBUS_RUN_SESSION[@]}" \ - "$TEST" "${TEST_ARGV[@]}" - die "exec \"$TEST\" failed" + "${NMTST_DBUS_RUN_SESSION[@]}" "$TEST" "${TEST_ARGV[@]}" + r=$? + [ $r == 0 ] || die "exec \"$TEST\" failed with exit code $r" + exit 0 fi if [[ -z "${NMTST_VALGRIND}" ]]; then diff --git a/tools/test-networkmanager-service.py b/tools/test-networkmanager-service.py index f990a0e4..a7788510 100755 --- a/tools/test-networkmanager-service.py +++ b/tools/test-networkmanager-service.py @@ -1077,6 +1077,9 @@ class Device(ExportedObj): elif isinstance(self, WifiDevice): if con_inst.get_type() == NM.SETTING_WIRELESS_SETTING_NAME: return True + elif isinstance(self, VlanDevice): + if con_inst.get_type() == NM.SETTING_VLAN_SETTING_NAME: + return True return False def available_connections_get(self): @@ -1630,6 +1633,9 @@ class NetworkManager(ExportedObj): ac = ActiveConnection(device, con_inst, None) self.active_connection_add(ac) + + gl.manager.devices_available_connections_update() + return ExportedObj.to_path(ac) def active_connection_add(self, ac): |