[master] 6613cca62 param: Add a hidden deprecated alias for coverage

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Mon Dec 13 17:08:09 UTC 2021


commit 6613cca62e5bf7193cb9717e476d47ab74a2e2a5
Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
Date:   Mon Dec 13 16:02:00 2021 +0100

    param: Add a hidden deprecated alias for coverage

diff --git a/bin/varnishd/mgt/mgt_param.c b/bin/varnishd/mgt/mgt_param.c
index 3502e2820..4a4ecbfcc 100644
--- a/bin/varnishd/mgt/mgt_param.c
+++ b/bin/varnishd/mgt/mgt_param.c
@@ -778,6 +778,8 @@ MCF_DumpRstParam(void)
 	    "output from varnishd -x parameter\n\n");
 	VTAILQ_FOREACH(pl, &phead, list) {
 		pp = pl->spec;
+		if (!strcmp("deprecated_dummy", pp->name))
+		    continue;
 		printf(".. _ref_param_%s:\n\n", pp->name);
 		printf("%s\n", pp->name);
 		for (z = 0; z < strlen(pp->name); z++)
diff --git a/bin/varnishtest/tests/b00078.vtc b/bin/varnishtest/tests/b00078.vtc
new file mode 100644
index 000000000..e732f1d2f
--- /dev/null
+++ b/bin/varnishtest/tests/b00078.vtc
@@ -0,0 +1,23 @@
+varnishtest "deprecated parameters"
+
+varnish v1 -cliok "param.set debug +syncvsl"
+
+shell -expect "+syncvsl" {
+	varnishadm -n ${v1_name} "param.show deprecated_dummy"
+}
+
+shell -expect "+syncvsl" {
+	varnishadm -n ${v1_name} "param.show -j deprecated_dummy"
+}
+
+shell -err {
+	varnishadm -n ${v1_name} "param.show" | grep deprecated_dummy
+}
+
+shell -err {
+	varnishadm -n ${v1_name} "param.show -l" | grep deprecated_dummy
+}
+
+shell -err {
+	varnishadm -n ${v1_name} "param.show -j" | grep deprecated_dummy
+}
diff --git a/include/tbl/params.h b/include/tbl/params.h
index 48b89aa76..964c2d255 100644
--- a/include/tbl/params.h
+++ b/include/tbl/params.h
@@ -1647,13 +1647,15 @@ PARAM_PCRE2(
  * When a parameter is renamed, but the a deprecated alias is kept for
  * compatibility, its documentation is minimal: only a description in
  * manual pages, a description and current value in the CLI.
+ *
+ * The deprecated_dummy alias is here for test coverage.
  */
 
 #define PARAM_ALIAS(al, nm) \
 	PARAM(, , al, tweak_alias, NULL, NULL, NULL, #nm, NULL, \
 	    "Deprecated alias for the " #nm " parameter.")
 
-/* PARAM_ALIAS(old, new) */
+PARAM_ALIAS(deprecated_dummy, debug)
 
 #  undef PARAM_ALIAS
 #  undef PARAM_ALL


More information about the varnish-commit mailing list