In a continuing test of his ability to hold together the Chinese leadership, Communist Party Chairman Hua Kuo-feng has managed to save the job of Peking Mayor Wu Teh through complicated behind-the-scenes maneuvers, Communist sources here say.

The eventual fate of Mayor Wu, 63, is expected to reveal much about Hua's skills in maintaining his own influence and that of other party officials of the post-revolutionary generation against attacks from revolutionary veterans who had been shut out of power until recently.

Posters attacking Wu were left on Peking walls long enough last week to indicate that they had some official sanction, but they are now gone, meaning that Wu survives. Other wallposter slogans tore down much more quickly - such as "False foreign devils have stolen power and our revolution is aborted" - show how attacks on individuals like Wu can threaten the whole post-Mao leadership and why all competing factions in the ruling Politburo have an interest in quietly settling their differences.

The Hong Kong Chinese language magazine Cheng Ming, whose articles have been endorsed in the past by the Communist press here, has reported that Wu was openly criticized in a crucial Peking party meeting in late November and early December, although he was reconfirmed at the meeting as head of the party and government appartus in the city. The magazine said a "noted scientist," thought by some to be physicist Chou Pie-yuan, criticized Wu while other "high personages," perhaps even Hua himself, defended the mayor.

The magazine's account of a challenge to Wu in early December helps explain a somewhat puzzling trip made by Hua to the Miyun reservoir on the northeastern outskirts of Peking Nov. 27. The official People's Dialy did not note the trip until Dec. 2, but then displayed the news prominently with pictures showing Wu shoveling dirt along with Hua at a dam reinforcement work sit. The trip now seems to have been a ringing endorsement of Wu at a time when he needed it.

Publication might have been delayed to give it maximum impact at the Peking People's Congress or because other members of the leadership tried to stop it.

Besides Hua and Wu, members of the post-revolutionary generation such as Politubro members Chi Teng-guei, Chen Yung-Kuei and Ni Chih-fu were shown, while revolutionary veterans like Vice Chairman Teng Hsiao-ping were not at the dam site.

Last week's wallposter campaign shows that resentment against Wu is still strong, however. He was charged with being overzealous in the crushing of an April 15, 1976, mass demonstration, perhaps the largest and most spontaneous in China since 1949. Scores of people were injured when Peking residents protested official neglect of the memory of the late premier Chou En-lai.

The demonstration took place in the last months of the life of Chairman Mao Tae-tung, when his most dogmatic followers were apparently taking advantage of his failing health to overpower their political opponents. Wu at the time seemed outspoken in support of the dogmatists and against more pragmatic veterans like Teng. The decision to blame the demonstration on Teng and remove him from power two days later was announced as the unanimous decision of the Politburo, including Hua and many other people who are still in power.

Since Mao died in late 1976, Chou has been restored to a towering position in official party histories and the press has looked more kindly at the actions of those who protested in defense of his memory. Clearly, many former protesters and their friends who were persecuted for their 1976 actions do not think that is enough.

Communist sources here, usually reluctant to comment on any reports of strife among central government leaders in Peking, say they have heard reports that Wu eventually would be transferred out of Peking to help soothe the 1976 protesters.

The attacks on the mayor have been unusually vehement for a period in which the leadership has constantly emphasized unity.

One cartoon portrayed Wu as a toy doll, the heavy-bottomed kind popular in China which always sways back upright after being knocked down. It included a pun on the mayor's name which has the same sound as words meaning "without virtue."