@@ -1455,6 +1455,56 @@ def test_non_sensitive_args_preserved_in_cli_command(self):
14551455 assert "http://localhost:8000" in cmd
14561456 assert "gpt2" in cmd
14571457
1458+ @pytest .mark .parametrize (
1459+ "flag, value" ,
1460+ [
1461+ param ("--input-tokens-mean" , "1024" , id = "input-tokens-mean" ),
1462+ param ("--input-tokens-stddev" , "0" , id = "input-tokens-stddev" ),
1463+ param ("--output-tokens-mean" , "128" , id = "output-tokens-mean" ),
1464+ param ("--output-tokens-stddev" , "32" , id = "output-tokens-stddev" ),
1465+ param (
1466+ "--synthetic-input-tokens-mean" , "1024" , id = "synthetic-input-tokens-mean" ,
1467+ ),
1468+ param (
1469+ "--synthetic-input-tokens-stddev" ,
1470+ "0" ,
1471+ id = "synthetic-input-tokens-stddev" ,
1472+ ),
1473+ ],
1474+ ) # fmt: skip
1475+ def test_token_count_flags_preserve_value_in_cli_command (self , flag , value ):
1476+ """Regression: flag names containing 'tokens' (plural — LLM token
1477+ counts) must not be redacted just because they share a substring with
1478+ auth-token flags. Reported via real-run output where every
1479+ --*-tokens-* flag value came back as '<redacted>'."""
1480+ cmd = self ._build_cli_command (
1481+ ["aiperf" , "profile" , "--model" , "gpt2" , flag , value ]
1482+ )
1483+ assert value in cmd , f"{ flag } value { value !r} should not be redacted"
1484+ assert REDACTED_VALUE not in cmd
1485+
1486+ @pytest .mark .parametrize (
1487+ "flag" ,
1488+ [
1489+ param ("--api-token" , id = "api-token" ),
1490+ param ("--api_token" , id = "api_token-underscore" ),
1491+ param ("--auth-token" , id = "auth-token" ),
1492+ param ("--access-token" , id = "access-token" ),
1493+ param ("--bearer-token" , id = "bearer-token" ),
1494+ param ("--id-token" , id = "id-token" ),
1495+ param ("--refresh-token" , id = "refresh-token" ),
1496+ ],
1497+ ) # fmt: skip
1498+ def test_auth_token_compound_flags_redacted_in_cli_command (self , flag ):
1499+ """Auth-token flag variants must still be redacted after tightening
1500+ the sensitive-token list away from the bare-'token' substring match."""
1501+ secret = "nv-secret-AUTH-TOKEN-9876543210"
1502+ cmd = self ._build_cli_command (
1503+ ["aiperf" , "profile" , "--model" , "gpt2" , flag , secret ]
1504+ )
1505+ assert secret not in cmd
1506+ assert REDACTED_VALUE in cmd
1507+
14581508
14591509# =============================================================================
14601510# ErrorDetails safe repr
0 commit comments